Skip to main content
Version: 1

Send Email

  • Category

    • Email
    • Communication
    • Utility
  • Flow Icon

Overview

The Send Email component sends one or more outbound emails from Flow using Salesforce’s Messaging.SingleEmailMessage.
It supports Org-Wide Email Addresses, reply-to, Contact targeting (for template merges), plain text / HTML bodies, email templates, and file attachments.


Inputs

Provide a collection of requests when you want to send multiple emails in one step; each request produces one result.

  1. emailTo (Optional)
    Comma-separated list of recipient email addresses (e.g., [email protected],[email protected]).

    • Used only if contactId is not provided.
  2. emailCC (Optional)
    Comma-separated list of CC addresses.

  3. subject (Optional)
    Email subject. Defaults to “No subject provided.” if blank.

  4. orgWideEmailId (Optional)
    Id of an Org-Wide Email Address to send from.

  5. senderDisplayName (Optional)
    Friendly display name for the sender.

  6. replyEmail (Optional)
    Sets the Reply-To address.

  7. recordId (Optional)
    Sets WhatId for the email (the related record for logging/merge contexts).

  8. contactId (Optional)
    Sets TargetObjectId (a Contact Id).

    • When set, Salesforce uses the Contact’s email address.
    • Required for most template merge use cases.
  9. textBody (Optional)
    Plain-text body.

  10. htmlBody (Optional)
    HTML body (if provided, HTML is used).

  11. templateId (Optional)
    Id of an Email Template to use.

    • For merge fields to resolve, you typically must provide contactId (TargetObjectId).
    • recordId can be used as WhatId for related-record merges.
  12. attachmentFiles (Optional)
    List of file attachments to include. Each item must have:

    • Name — filename (e.g., invoice.pdf)
    • Body — file content as Base64 (converted to Blob in Apex)
  13. saveAsActivity (Optional, Boolean)
    If true, the email is saved as an Activity.


Outputs

For each request, a Results entry is returned:

  • statusCode200 on success; 500 when Salesforce reports send errors.
  • statusMessage — Success or error details (includes SendEmailError info when available).

Behavior & Notes

  • If contactId is supplied, the component targets the Contact (enables template merges and uses Contact’s email). If not, recipients are taken from emailTo.
  • If templateId is supplied, Salesforce will use the template body; you can still pass textBody/htmlBody when needed (template has precedence for merges).
  • Attachments are added via Messaging.EmailFileAttachment from attachmentFiles.
  • A Plinqx subscription check is performed before returning results.


Example Scenario – Sending Case Notifications to Customers

Scenario Overview:

A Salesforce org wants to automatically notify customers when their support case status changes. The email should use a Salesforce email template for personalization, send from an Org-Wide Email Address, and log the email as an Activity on the Case.

Implementation with Send Email Component:

Flow Setup for Case Updates:
Create a Salesforce flow triggered when a Case record is updated (e.g., when the Status field changes).

Adding Send Email Component:
Include the Send Email component in the flow to generate and send the notification.

Configuring Input:

  • contactId is set to the Contact associated with the Case.

  • recordId is set to the Case Id, so the email is logged against the record.

  • templateId is set to the Id of the prebuilt Case Update email template.

  • orgWideEmailId is set to the Id of the support Org-Wide Email Address.

  • saveAsActivity = true to record the outbound message in Salesforce.

Executing Send Email:
The component merges template fields with the Contact and Case data, sends the email using the Org-Wide Email Address, and stores it as an Activity.

Utilizing Results:
The component returns a response with:

  • statusCode = 200 if the send succeeded.

  • statusMessage detailing the result (or error if applicable).
    Flow can branch based on these results—for example, logging failures or retrying.


Troubleshooting

  • Template merges not working → Ensure contactId (TargetObjectId) is provided and the template supports the merge context.
  • Recipients ignored → When contactId is set, Salesforce uses the Contact’s email; emailTo is ignored.
  • Attachments not appearing → Verify each attachment has Name and Base64 Body.
  • Send errors → Check statusMessage for SendEmailError details (status code, message, fields).