SfSkills Domains Docs GitHub

Home / flow / flow-email-and-notifications

flow-email-and-notifications

Use when sending emails, in-app bell notifications, SMS, or Slack messages from Salesforce Flow. Trigger keywords: 'send email action', 'custom notification', 'bell icon', 'Send Custom Notification', 'SMS from flow', 'Slack notification flow'. NOT for designing or managing email templates from Setup (use admin/email-templates-and-alerts), and NOT for Email Alerts defined in workflow rules.

Open the skill folder on GitHub


Flow Email and Notifications

Use this skill when a Salesforce Flow needs to deliver a message — email, in-app notification, SMS, or Slack — to users or external addresses. Covers the Send Email action, Send Custom Notification action, SMS via Digital Engagement, and Slack via the Salesforce for Slack integration. NOT for creating or managing email templates in Setup (use admin/email-templates-and-alerts), and NOT for Email Alert workflow actions.

Three design mistakes this skill catches: (1) using Send Email when a Custom Notification would be faster and more actionable for internal users, (2) confusing Flow's Send Email with Email Alerts (different template sources!), (3) designing bulk notifications without respecting the 1,000/hour cap.


Before Starting

Check for salesforce-context.md in the project root. If present, read it first.

Gather if not available:


Core Concepts

ActionWhere the body comes fromAddressed toLicenseCeiling that bites
Send EmailA Flow Text Template resource, or text typed inline — not a Classic Email TemplateAn email-address string, or a User IDStandard5 MB per message; mass email caps at 1,000 recipients per day
Send Custom NotificationPlain text carrying {!variable} merge fields; HTML is not renderedA collection of User IDs, 15- or 18-characterStandard1,000 per hour, org-wide
Send SMSThe message body itselfAn E.164 phone number, e.g. +15551234567Digital Engagement add-onWhatever the messaging channel imposes
Post Message to SlackThe message textA Slack channel, by ID or by nameSalesforce for Slackroughly 40,000 characters per message

Three distinctions cause most of the failures here. Send Email ignores the Classic Email Templates sitting in Setup — point it at a Flow Text Template resource instead. Email Alerts do read those Classic templates, but an Email Alert is a separate action inherited from Workflow Rules, and reaching for one when you meant the other is an easy slip. And recipientIds on a Custom Notification takes User IDs and nothing else: put an email address or a Contact ID there and it fails.

references/well-architected.md carries the fuller comparison, the prerequisites, and the architectural tradeoffs.


Common Patterns

Pattern 1: In-App Bell Notification on Record Change

When to use: A record-triggered or autolaunched Flow needs to alert a specific Salesforce user immediately (e.g., escalation to owner, approval request follow-up).

Prerequisite — a Custom Notification Type must exist first. Build it in Setup, or deploy the metadata:

<!-- Path: force-app/main/default/notificationtypes/
     File: Case_Escalation_Alert.notiftype-meta.xml
     desktop and mobile are the delivery channels; leaving slack false keeps
     this notification inside Salesforce. -->
<?xml version="1.0" encoding="UTF-8"?>
<CustomNotificationType xmlns="http://soap.sforce.com/2006/04/metadata">
    <customNotifTypeName>Case_Escalation_Alert</customNotifTypeName>
    <desktop>true</desktop>
    <masterLabel>Case Escalation Alert</masterLabel>
    <mobile>true</mobile>
    <slack>false</slack>
</CustomNotificationType>

What to put in each Send Custom Notification input:

Input FieldValueWhat to watch
Custom Notification Type ID{!customNotifTypeId}Resolve it by querying CustomNotificationType for DeveloperName = 'Case_Escalation_Alert'
Recipient IDs{!recipientCollection}A Text Collection holding User IDs, 15- or 18-character
Title"Case Escalation — Action Required"250 characters is the cap, but desktop truncates around 120 with an ellipsis — front-load the part the reader must act on
Body{!notificationBody}750 characters allowed, roughly 320 shown on desktop; plain-text Text Template with merge fields
Target ID{!$Record.Id}The record the notification opens when tapped

Why not email: Bell notifications are synchronous with the transaction, appear immediately in the app, and do not require an email address. Email adds latency and inbox noise for internal user alerts.

Walked through end to end in references/examples.md, Example 1.

Pattern 2: Confirmation Email to External Contact

When to use: A Flow needs to email a non-Salesforce user (customer, partner, applicant) with dynamic content after a record creation or form submission.

What to put in each Send Email input:

Input FieldValueWhat to watch
Email Addresses (To){!$Record.Applicant_Email__c}One address, or several separated by commas
Subject"Application Received — {!jobTitle}"Merge fields work, whether via formula or plain text
Body{!applicantEmailBody}Must be a Text Template resource; a Classic Email Template ID will not do
Email Template ID(leave blank)Classic Template IDs are not accepted by this action
Sender AddressOrg-Wide Email AddressSet one up in Setup rather than sending from a personal address

Wire a fault connector every time. SendEmailException is what you get when a limit is breached or the address is malformed.

Why not an Email Alert: an Email Alert binds its template at design time in Setup. Send Email lets both the recipient and the body vary at run time, which is the whole point here.

Walked through end to end in references/examples.md, Example 2.

Pattern 3: Bulk Internal Alert With Rate-Limit Awareness

When to use: Record-triggered Flow needs to notify many users during a bulk save (e.g., data-load alert to 200 case owners).

Structure:

  1. Compute the User ID collection in advance.
  2. Check the collection size; if > hourly limit threshold, aggregate to a digest (single notification to a manager role rather than per-user).
  3. For approved bulk sends, fire Send Custom Notification with the collection.
  4. Track hourly volume via a custom Notification_Log__c object so the next bulk run can back off if near cap.

Why not unbounded: 200 record load with per-record notification × 5 cascading automations = bell-cap exhaustion quickly.

Pattern 4: Slack Channel Post for Cross-Team Awareness

When to use: Internal teams not on Salesforce (dev, finance, security) need awareness of a Salesforce event.

Structure: Flow uses Post Message to Slack with a pre-provisioned channel. Message contains a link back to the record (includes the recordUrl merge pattern).


Decision Guidance

RequirementRecommended ChannelKey Condition
Notify internal Salesforce user in-appSend Custom Notification (Pattern 1)User ID must be available; Custom Notification Type must exist
Email external contact or customerSend Email action in Flow (Pattern 2)Recipient is an email address string; body is a Text Template
Email from a fixed, managed templateEmail Alert invoked from FlowTemplate is a Classic Email Template; recipient is defined by the alert
Send SMS to a phone numberSend SMS actionRequires Digital Engagement add-on license
Post to Slack channelPost Message to Slack (Pattern 4)Requires Salesforce for Slack connected workspace
Bulk alert to many users at onceCustom Notification (Pattern 3) with rate-limit gateUp to org limit; watch 1,000/hour cap
Alert to inactive Salesforce userEmail onlyCustom Notification won't deliver to inactive users
HTML-rich email to externalEmail Alert with Classic TemplateFlow's Send Email is plain-text / text-template only

  1. Confirm the channel and license: Determine which notification channel the requirement calls for and verify the org has the required add-ons (Digital Engagement for SMS, Salesforce for Slack for Slack). Do not proceed with unavailable actions.
  2. Identify recipient wiring: For Send Custom Notification, locate the User ID source on the triggering record. For Send Email, locate the email address field. Confirm whether a collection or single value is needed.
  3. Create prerequisite metadata: For custom notifications, create the Custom Notification Type in Setup before building the Flow action. For Slack, confirm the workspace connection is active.
  4. Configure the action: Add the appropriate action element (Send Email, Send Custom Notification, Send SMS, Post Message to Slack). Map all required inputs. For email, set Subject, Body (Text Template), and To address. For notifications, set recipientIds (collection), title, body, and optionally targetId.
  5. Add a fault connector: Every notification action can fail. Wire a fault connector to capture $Flow.FaultMessage, log or notify an admin, and avoid silent failures.
  6. Test with real User IDs and addresses: Activate the Flow in a sandbox and trigger the notification. Verify delivery in the notification bell, inbox, Slack, or SMS as appropriate. Debug mode shows the action execution but not delivery confirmation.
  7. Review limits before go-live: Confirm email volumes are within org limits. For custom notifications on high-volume automations, calculate worst-case hourly send rate against the 1,000/hour cap.

Review Checklist


Salesforce-Specific Gotchas

  1. Custom Notification recipientIds must be User IDs, not email addresses — The Send Custom Notification action requires Salesforce User record IDs (15 or 18-character). Passing an email address string causes a runtime error that is often reported as "notification not delivered" rather than a clear field-level error.
  2. Send Email does not use Classic Email Templates — Flow's Send Email action cannot reference a Letterhead or Classic HTML template from Setup. Body content must come from a Flow Text Template resource or an inline text value. Practitioners who expect template-driven emails must use an Email Alert action instead.
  3. The 10,000 notification-actions/hour org limit drops notifications silently — a fault connector will NOT catch it — Salesforce documents that beyond the cap "no more notifications are sent in that hour, and all unsent notifications are lost," resuming next hour. No exception is thrown, so the flow does not fault and does not roll back, and there is no fault email. Detection requires your own instrumentation, not error handling.
  4. SMS is invisible without Digital Engagement — no fallback action appears — If the Digital Engagement add-on is not provisioned, the Send SMS action does not appear in Flow Builder at all. There is no placeholder or error message.
  5. Slack Post Message requires an active connected workspace, not just package installation — Installing the Salesforce for Slack managed package does not automatically make the action work. An admin must authenticate and connect a Slack workspace in Setup.
  6. Custom Notification title is capped at 250 characters (body 750), but desktop truncates the display far earlier — titles render to about 120 characters and bodies to about 320 before an ellipsis. Do not conflate the two numbers: 250/750 is what the API accepts, 120/320 is what a user reads. Front-load the actionable text.
  7. Email deliverability setting "No access" blocks all outbound emails — Sandbox orgs default to this setting; Flow's Send Email succeeds in the flow but nothing leaves the org. Verify deliverability is All email in Setup before testing.
  8. Custom Notifications to inactive users don't error but don't deliver — Filter recipient collections by IsActive=true before passing to the action.
  9. Slack message character limit (~40k) + formatting caveats — Slack truncates long messages; BlockKit JSON isn't supported from the standard Flow action.
  10. Digest patterns need state to work correctly — aggregating notifications across flow runs requires a counter object; don't try to do it within a single run.

Proactive Triggers

Surface these WITHOUT being asked:


Output Artifacts

ArtifactDescription
Channel decision tableWhich action to use for email, bell, SMS, or Slack
Recipient wiring planHow to source User IDs or email addresses from the Flow context
Prerequisite checklistCustom Notification Type setup, add-on licenses, Slack workspace
Limit reviewEmail daily limit, custom notification hourly cap, message size
Rate-limit gate designPattern 3's counter / digest approach if bulk alerts required

Package files