Skip to content

FLOW_SendEmail.DTO_Request ​

Class · Group: Email

Learn it: Utilities guide

apex
global inherited sharing class FLOW_SendEmail.DTO_Request

Data Transfer Object (DTO) representing the input parameters for a single email request.


Fields ​

FieldDescription
global List<Id> fileIdsA list of ContentVersion IDs to attach to the email.
global List<DTO_NameValue> mergeFieldsA list of custom key-value pairs to replace placeholders in the email body (e.g., [InvoiceNumber]).
global String orgWideEmailAddressThe email address defined in Organization-Wide Email Addresses to be used as the sender.
global Boolean saveAsActivityWhether the email is logged as an activity.
global String templateUniqueNameThe DeveloperName of the Email Template.
global String toAddressThe recipient.
global Boolean useStandardLogActivityControls 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 whatIdThe ID of the record that the email is related to (e.g., Opportunity, Case).

fileIds ​

apex
@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> fileIds

Type: List

A list of ContentVersion IDs to attach to the email.

mergeFields ​

apex
@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> mergeFields

Type: List

A list of custom key-value pairs to replace placeholders in the email body (e.g., [InvoiceNumber]).

orgWideEmailAddress ​

apex
@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 orgWideEmailAddress

Type: String

The email address defined in Organization-Wide Email Addresses to be used as the sender.

saveAsActivity ​

apex
@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 saveAsActivity

Type: 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 ​

apex
@InvocableVariable(required=true description='The unique name (DeveloperName) of the email template to generate the email content.' label='Email Template Unique Name') global String templateUniqueName

Type: String

The DeveloperName of the Email Template.

toAddress ​

apex
@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 toAddress

Type: String

The recipient. Can be a standard Email Address or the Salesforce ID of a Contact, Lead, or User.

useStandardLogActivity ​

apex
@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 useStandardLogActivity

Type: 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 ​

apex
@InvocableVariable(required=true description='The Id of a record related to the email for merge field data (WhatId).' label='Related To WhatId') global Id whatId

Type: Id

The ID of the record that the email is related to (e.g., Opportunity, Case). Used for merge fields.