You need to sign in to do that
Don't have an account?
Oldwen Adriano
Understanding mail merge or SF email from DEV perspective
Hello,
Is Mail Merge a utility I can use to send emails thru triggers or code? Or is this just a wysiwyg interface to send a one time email based on templates I create? In a nutshell, I need to create a trigger that sends an email after a record is updated and incorporate fields from my object into the email.
Thank you,
Oldwen
You can create an email with Apex code and send it from the trigger. You can find here information about how to do it: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_forcecom_email_outbound.htm
However, I DO NOT really recommend you to do it there, because if for any reason the trigger is call in bulk, you will send lot of emails and you can hit a governor limit.
In addition, there are several ways to send an email via the platform. For intance, Process Builder.
After creating an email template, adding the fields you want like I show in this image:
You can create a simple Process Builder. Mine send the email if the Account record is created or updated and the Account Number field is "123"
If you don't have an Email Alert, you can create it on the fly (there is a link below the field) and select your email template.
I hope this helps.
All Answers
You can create an email with Apex code and send it from the trigger. You can find here information about how to do it: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_forcecom_email_outbound.htm
However, I DO NOT really recommend you to do it there, because if for any reason the trigger is call in bulk, you will send lot of emails and you can hit a governor limit.
In addition, there are several ways to send an email via the platform. For intance, Process Builder.
After creating an email template, adding the fields you want like I show in this image:
You can create a simple Process Builder. Mine send the email if the Account record is created or updated and the Account Number field is "123"
If you don't have an Email Alert, you can create it on the fly (there is a link below the field) and select your email template.
I hope this helps.
Thank you...
I was able to find the process builder. My object that I need to work with is not in the object drop down list. Can you help me understand why it's not there?
Thank you,
Oldwen
You can find a video about Process Builder here: https://www.youtube.com/watch?v=APiJg7908jk
Also here you can get information about differences between Process Builder and Workflow: https://help.salesforce.com/apex/HTViewHelpDoc?id=process_which_tool.htm&language=en_US (https://help.salesforce.com/apex/HTViewHelpDoc?id=process_which_tool.htm&language=en_US) Actually you would be able to sort yor issue with Workflow as well, although Process Builder is easier to visualize.
Were you able to find your object in the dropdown list? Which is your object? Custom or Standard? In theory all your objects should be available.
Agustina
Thank you,
Oldwen
But if not, you can do the same with workflow https://www.youtube.com/watch?v=T4N3XDuBvo0 where you can find also Leads:
And the process is quite similar