Loading
Salesforce から送信されるメールは、承認済ドメインからのみとなります続きを読む

Send email options for DML operations carried out in the Apex code

公開日: Oct 13, 2022
解決策

Even though auto-sent emails can be triggered by actions in the Salesforce user interface, the DMLOptions settings for emailHeader take effect only for DML operations carried out in Apex code.

This behavior can be controlled using the DMLOptions class during execution.  Here is an example of how this can be done.

Database.DMLOptions dlo = new Database.DMLOptions();
dlo.emailHeader.triggerUserEmail = true;

database.insert(tasksToCreateList,dlo);

The following are properties for DmlOptions.EmailHeader.

  • triggerAutoResponseEmail : Indicates whether to trigger auto-response rules (true) or not (false), for leads and cases.
  • triggerOtherEmail : Indicates whether to trigger email outside the organization (true) or not (false).
  • triggerUserEmail : Indicates whether to trigger email that is sent to users in the organization (true) or not (false).

DMLOptions

ナレッジ記事番号

000385486

 
読み込み中
Salesforce Help | Article