Flow: How To Send Emails In Two Ways
Surprisingly it took me a long time to realize that there are actually two ways to send emails in Flow. As a result, I want to share the solutions with you so you don’t miss out on this information either!
1 – Compose Email Directly In Flow Builder
Step 1 – Use “Send Email” Action
There is a standard Flow action called “Send Email”, where you can write the email directly in Flow.
Step 2 – Enter Important Input
You can use a static string, a text template, or other resources in the Body and the Subject. Check out How To Use “Action” for detailed explanations of each field.
2 – Use Standard Email Alert
Step 1 – Create Email Templates and Email Alert
Go to Setup > Email Alerts. To create a new email alert, you need either a Classic email template or a Lightning email template.
Step 2 – Use Action and Search For The Email Alert
Once you create the email alert, it will show up in the available actions list. All you need to do is to populate the Record Id.
When To Use Which?
Standard Action: When you want to write a dynamic email using Flow variables
By using the standard Send Email action, you can customize the content or recipients using the variables you created in the flow.
However, you cannot reuse the email action in other flows.
Email Alert: When you want to organize and reuse the alerts in other flows or processes
You can organize Email Alerts in Setup and reuse them in Workflow, Process Builder, and Flow Builder. If you don’t need to write a dynamic email, using Email Alerts would be the best option.
You can read more on Lightning Email Template in Automation and their behaviors in Email Alert Action.
Both of those options are problematic. The Send Better Email action on UnofficialSF is the thing to use. SBE supports Lightning templates and enables flexible field substitution. https://unofficialsf.com/send-better-email-flow-action/
Hi,
I also love that solution from Unofficial SF. My plan is to introduce the standard features first and will share useful packages after thorough reviews.
How do I use Flow to allow the email to be “previewed” before sending?
Hello! Unfortunately I don’t think it’s possible to email from template and keep/preview the letterhead. However you can get the template and put the subject/body as default values in text fields, and then use a simple email action to send out the edited email (this will make the email becomes plain text though)
Is there any reason why you need to build it with flow, instead of using the activity email composer?
I normally send emails using the “Email Template, Email Alert, Workflow Rule” thing, but for this email alert I have the following:
I’d also like the “sent emails” history to show up in the right related pane (on the record page)
I ended up using “Salesforce Lightning Templates” which includes a “Preview” button. Thanks anyway.
Hi J A, sorry for the late response! I am glad that you found the solution that meets your needs, but if you want to explore the possibilities of having two objects or a list or related objects, feel free to write me an email and we can discuss together! (Might need some custom components, etc)
Hello – I’m trying to use an email template / letterhead, and therefore chose to use the Email Alert. This works well in my flow, but my Community Users get an error (insufficient access rights on cross-reference id) It’s definitely the email alert causing the issue, as other methods work (Note: I did install Send Better Email, but it falls short in my use case – my email recipient is a custom object, and SBE requires contact/lead/user in conjunction with at template…)
Any thoughts on solving xref error for my users invoking the email alert in a screen flow?
Hi Tom, hmm I am not a Community Cloud expert, but I do know that the security setting is very tricky for this product. Even if you run the screen flow in system context, you still need to give them permission to the relevant objects. Have you verified if the community users all have access to the custom objects (and any object referenced in the email alert)? If you have, let’s brainstorm on other possible causes together.
I am struggling with the same issue regarding email templates. Did you find a solution for your problem?
I’m on Sales Cloud with System Admin user. I have created a record triggered flow where the flow is triggered when the custom object is created. After that, the flows fetch all the account records with type ‘Customer-Direct’ and then it fetches the contacts related to those accounts and sends them an email. While debugging, I see that it fetches the records but shows the same error mentioned above, i.e. ‘insufficient access rights on cross-reference id’ when Email Alert action takes place. I tried with permission and sharing settings but didn’t work. How can I resolve this?
Hi all, the cross-reference id error is quite a generic one and might be come from different reasons. I suggest checking out this thread or submit a case to Salesforce: https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000A7telSAB
This can happen if the users doesn’t have access to the folder the email template is in.
Guys, what if I need to send emails through flow and this emails need to be recognized by email to case? Is this transparent as I’d already configured On Demand email to case? I understand by documentation that email alert can work with email to case, however, there’s no reference for send email action
Hi Ed, yes the email-to-case should work with the simple send email action as well.
Hi, can you please help me with a flow I created to send email alert to Public groups when a new article is published. It is not sending email alert although the flow seems to work when debug it, but it doesn’t send email in reality. doesn’t pick up the selected Public groups when created a new test article. thanks for any help.
Hi Hafsa, if the flow doesn’t seem to have an error when debugging but the email is still not sent, I would suggest checking if the sender address is valid to use – go to this post and check point 6&7 – try to use other OrgWide email to see if it works. Also try to set up default workflow user and automated process user email in the Automation setting.
If none of these works, log a ticket with Salesforce support instead. Hope this helps!
Thanks a lot. I will try this 😊
There is definately a lot to find out about this subject. I like all the points you made
Simply wish to say your article is as amazing. The clearness in your post is just nice and i could assume you’re an expert on this subject. Well with your permission let me to grab your feed to keep updated with forthcoming post. Thanks a million and please carry on the gratifying work.