FLOW_SendEmail.DTO_Request
Class · Group: Email
Learn it: Utilities guide
global inherited sharing class FLOW_SendEmail.DTO_RequestData Transfer Object (DTO) representing the input parameters for a single email request.
Fields
| Field | Description |
|---|---|
| global List<Id> fileIds | A list of ContentVersion IDs to attach to the email. |
| global List<DTO_NameValue> mergeFields | A list of custom key-value pairs to replace placeholders in the email body (e.g., [InvoiceNumber]). |
| global String orgWideEmailAddress | The email address defined in Organization-Wide Email Addresses to be used as the sender. |
| global Boolean saveAsActivity | Whether the email is logged as an activity. |
| global String templateUniqueName | The DeveloperName of the Email Template. |
| global String toAddress | The recipient. |
| global Boolean useStandardLogActivity | Controls the mechanism used for Activity Logging when saveAsActivity is true; without an activity wanted it has no effect, and the email is sent to the recipient's address. |
| global Id whatId | The ID of the record that the email is related to (e.g., Opportunity, Case). |
fileIds
@InvocableVariable(required=false description='A list of ContentVersion or Document Ids to attach as files to the email.' label='List of File Ids for Attachments') global List<Id> fileIdsType: List
A list of ContentVersion IDs to attach to the email.
mergeFields
@InvocableVariable(required=false description='List of name-value pairs for custom merge fields to replace in the email body. Placeholders must be in the format [mergefieldname].' label='Custom Merge Fields') global List<DTO_NameValue> mergeFieldsType: List
A list of custom key-value pairs to replace placeholders in the email body (e.g., [InvoiceNumber]).
orgWideEmailAddress
@InvocableVariable(required=true description='The org-wide email address to be used as the sender (From address).' label='Sender Org Wide Email Address') global String orgWideEmailAddressType: String
The email address defined in Organization-Wide Email Addresses to be used as the sender.
saveAsActivity
@InvocableVariable(description='Log the email as an activity. Custom logging needs a Related To Id; standard logging needs a Contact or Lead recipient.' label='Save as Activity' placeholderText='false' defaultValue='false') global Boolean saveAsActivityType: Boolean
Whether the email is logged as an activity. With custom logging (useStandardLogActivity false) the framework inserts a Task against whatId, so a null whatId logs nothing. With standard logging Salesforce logs the email itself for a Contact or Lead recipient, and the recipient Id reaches the flow only when this is true; a User recipient is refused, because Salesforce does not log an email sent to a User.
templateUniqueName
@InvocableVariable(required=true description='The unique name (DeveloperName) of the email template to generate the email content.' label='Email Template Unique Name') global String templateUniqueNameType: String
The DeveloperName of the Email Template.
toAddress
@InvocableVariable(required=false description='The Id of the Contact, Lead, or User, or the recipient email address. Used to resolve "TargetObjectId".' label='To Address or Target WhoId') global String toAddressType: String
The recipient. Can be a standard Email Address or the Salesforce ID of a Contact, Lead, or User.
useStandardLogActivity
@InvocableVariable(description='True: Salesforce logs the email (Contact or Lead recipients only). False: the framework logs a Task itself. Applies only with Save as Activity.' label='Use Standard Activity Logging' placeholderText='false' defaultValue='false') global Boolean useStandardLogActivityType: Boolean
Controls the mechanism used for Activity Logging when saveAsActivity is true; without an activity wanted it has no effect, and the email is sent to the recipient's address. Standard logging needs a Contact or Lead recipient: Salesforce does not log an email sent to a User, so that request is refused. With custom logging a User recipient's Task is related to whatId only, because a Task cannot name a User as its WhoId.
true: Uses standard Messaging.SingleEmailMessage activity logging (counts towards limits).
false: Uses a custom Task insertion approach (via Workflow Engine/Flow).
whatId
@InvocableVariable(required=true description='The Id of a record related to the email for merge field data (WhatId).' label='Related To WhatId') global Id whatIdType: Id
The ID of the record that the email is related to (e.g., Opportunity, Case). Used for merge fields.