Skip to content

PranavNagrecha/AwesomeSalesforceSkills / skills/admin/email-templates-and-alerts

email-templates-and-alerts

Verified

Use when designing, reviewing, or troubleshooting Salesforce email templates, email alerts, and declarative notification design. Triggers: 'Lightning Email Template', 'email alert', 'merge field', 'org-wide email', 'too many emails', 'mass email limit'. NOT for migrating Classic templates to Lightning — use admin/classic-email-template-migration. NOT for sending email from Apex — use apex/apex-outbound-email-patterns.

references/examples.md

View on GitHub
# Examples: Email Templates and Alerts

---

## Example: Case SLA Breach Email Alert

**Requirement:** Notify the case owner and support manager when a high-priority case is about to breach SLA.

**Pattern:**
- Trigger: Record-Triggered Flow with strict entry criteria
- Mechanism: Email Alert
- Sender: Org-Wide Email Address `support@example.org`
- Template: `Case_SLA_Breach_Warning`

**Subject example:**
```text
SLA warning: Case {!Case.CaseNumber} is nearing breach
```

**Why this works:** One operational event, one transactional email, clear sender identity.

---

## Example: Approval Reminder Template

**Requirement:** Send approvers a reminder with the essential record context, not the full novel.

**Body structure:**
- what needs review,
- why it needs approval,
- key values,
- link to record,
- clear next action.

```text
Opportunity {!Opportunity.Name} requires discount approval.
Discount requested: {!Opportunity.Discount_Percent__c}
Amount: {!Opportunity.Amount}
Open record: {!Opportunity.Link_To_Record__c}
```

**Rule:** Approval reminders should reduce friction, not restate the entire record page.

---

## Example: Internal Status Change Alert With Duplicate-Email Protection

**Requirement:** Notify account managers when onboarding status changes to `Ready for Handoff`.

**Trigger rule:**
```text
Only send when Status changes TO Ready for Handoff
and Prior Status was not Ready for Handoff
```

**Why this matters:** Without the prior-value check, later edits on the same record keep sending the same email.

---

## Running the template checker on these files

```bash
python3 skills/admin/email-templates-and-alerts/scripts/check_email_templates.py --manifest-dir force-app/main/default
```

`--manifest-dir` is an alias of the positional path, so `check_email_templates.py force-app/main/default/email` is equivalent. Only `*.email`, `*.email-meta.xml`, and body files under an `email/` directory are linted — a `sender-identity-note.md` or deploy-order note beside the templates is documentation, not a template, and is skipped. REVIEW findings print and exit 0; `--strict` makes them exit 1. Exit 1 without `--strict` means an ERROR: the paths matched no template artefact, or a `.email-meta.xml` will not parse.
brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 323kUpdated Claude CodeCodexVerifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 198kUpdated Claude CodeCodexVerifiedInstall