SingleEmailMessage Methods | how to send an email from apex | salesforce developer | sfdc quest

Поділитися
Вставка
  • Опубліковано 18 жов 2024

КОМЕНТАРІ • 9

  • @SasikalaK-jw6mc
    @SasikalaK-jw6mc Рік тому

    Thank you...Nice explanation

  • @TK-vt3ep
    @TK-vt3ep Рік тому +1

    How to include cc, bcc as well and email template to use here?

    • @SFDCQuest
      @SFDCQuest  Рік тому

      use the below method for the same
      setTemplateId(templateId)
      developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_classes_email_outbound_single.htm#apex_Messaging_SingleEmailMessage_setTemplateId
      setBccAddresses(bccAddresses)
      developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_classes_email_outbound_single.htm#apex_Messaging_SingleEmailMessage_setBccAddresses
      setCcAddresses(ccAddresses)
      developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_classes_email_outbound_single.htm#apex_Messaging_SingleEmailMessage_setCcAddresses

    • @TK-vt3ep
      @TK-vt3ep Рік тому

      This is through class, that i know but how to do that through flow without using apex action.

    • @SFDCQuest
      @SFDCQuest  Рік тому

      @@TK-vt3ep here are options for sending an email
      help.salesforce.com/s/articleView?id=sf.flow_build_actions_email.htm&type=5
      you can use email alert to refer to your email template. you can get full control of the parameters using apex action. Please let us know if you know of any other alternative. thanks.

    • @TK-vt3ep
      @TK-vt3ep Рік тому

      I think you are not getting the question, for sending email we can use native or custom approach, however using native approach (like using email alert etc. In the flow) we can only use recipient email id which will be used as TO. What if i need to add cc and bcc as well along with email template, then there is no way for using those in the flow but using apex action only.
      That is what i was asking you , if you know how to send to, cc and bcc email recipient using flow elements rather than calling apex action.

    • @SFDCQuest
      @SFDCQuest  Рік тому

      @@TK-vt3ep Dear TK, I hope you have reviewed the documents shared in the earlier comments. Here is the summary again, we can use the email template from the email action but not the cc and bcc options. since that option is not provided. feel free to use the apex action for your requirement. Thanks.