Email Class (Base Email Methods)
Email Methods
The following are methods for Email. All are instance methods.
setBccSender(bcc)
Indicates whether the email sender receives a copy of the email that is sent. For a mass
mail, the sender is only copied on the first email sent.
Signature
public Void setBccSender(Boolean bcc)
Parameters
- bcc
- Type: Boolean
Return Value
Type: Void
Usage
setReplyTo(replyAddress)
Optional. The email address that receives the message when
a recipient replies.
Signature
public Void setReplyTo(String replyAddress)
Parameters
- replyAddress
- Type: String
Return Value
Type: Void
setTemplateID(templateId)
The ID of the template to be merged to create this email. Specify a value for
setTemplateId, setHtmlBody, or
setPlainTextBody. Or, you can define both setHtmlBody
and setPlainTextBody.
Signature
public Void setTemplateID(ID templateId)
Parameters
- templateId
- Type: ID
Return Value
Type: Void
Usage
setSaveAsActivity(saveAsActivity)
Optional. The default value is true, meaning the email is saved
as an activity. This argument only applies if the recipient list is
based on targetObjectId or targetObjectIds. If HTML email tracking is enabled for the organization, you will
be able to track open rates.
Signature
public Void setSaveAsActivity(Boolean saveAsActivity)
Parameters
- saveAsActivity
- Type: Boolean
Return Value
Type: Void
setSenderDisplayName(displayName)
Optional. The name that appears on the From line of the
email. This cannot be set if the object associated with a setOrgWideEmailAddressId for a SingleEmailMessage has
defined its DisplayName field.
Signature
public Void setSenderDisplayName(String displayName)
Parameters
- displayName
- Type: String
Return Value
Type: Void
setUseSignature(useSignature)
Indicates whether the email includes an email signature
if the user has one configured. The default is true, meaning if the user has a signature
it is included in the email unless you specify false.
Signature
public Void setUseSignature(Boolean useSignature)
Parameters
- useSignature
- Type: Boolean
Return Value
Type: Void