Send Rich Email (Send HTML Email Action)

This action has been updated. See the new version here.

Notify of
Inline Feedbacks
View all comments
Evan McHugh

I’m excited to be able to use this. however my instance is Spring ’20 and installation is consistently failing on the managed versions with an error “No such column ‘LastViewedDate’ on entity ‘Account’. I was able to install the managed version, however the apex action isn’t showing up. Anything I’m missing from install instructions?

Anna Proviz

Hello, I have tried to install, both versions – with and without examples etc. to our Salesforce and get this error: This app can’t be installed. There are problems that prevent this package from being installed. Apex compile failureApex class opportunityFillProdcts: line 13, column 14: Variable does not exist: Administrator__cApex compile failureApex class opportunityFillProdcts: line 15, column 18: Variable does not exist: Administrator__cApex compile failureApex class opportunityFillProdcts: line 18, column 29: Variable does not exist: Administrator__cApex compile failureApex class opportunityFillProdcts: line 24, column 14: Variable does not exist: Administrator__cApex compile failureApex class opportunityFillProdcts: line 26, column 25: Variable does not… Read more »

Alex Edelstein

This component doesn’t have anything to do with ‘opportunityFillProdcts’, so what’s happening is that you’ve got some invalid apex on your org that’s generating those errors. It’s going to block _all_ package installation, so you want to figure it out. The most straightforward thing to do, if you can, is uninstall that apex class opportunityFillProdcts. Alternative, figure out why it can’t find that variable.

Anna Proviz

Hi Alex,

Thanks for your quick reply.

We don’t have a class called “opportunityFillProdcts”.

Any another suggestions?

Thanks in advance,


Jack Pond

Anna, When you do the install, it is highly likely on install that other test classes or triggers are being run that are not related to this component. opportunityFillProdcts is likely either a custom Apex Class that is either being run as part of another Apex Test Class or a trigger that is being executed. Either may be part of another installed package. You should be able to see this class (in lightning) as a system administrator using Setup–>Custom Code–>Apex Class. If it does not allow you to see the code, then it is part of another installation package. You… Read more »

Anna Proviz

Hi Alex,

Thanks for your reply again 🙂

I understand what you say but we don’t have any managed or unmanaged apex class called “opportunityFillProdcts” I looked in the Apex classes.


Please add a warning at the top of this page that the Send HTML Email component can only send a maximum of 10 emails per transaction (which often equates to a limit of 10 emails per flow).

Jack Pond

Good point @davcondev, we are adding MassEmail support with 1.33.2 (Summer ’20), but some of the limitations are still organizational. For example, you can only send 10 for ANY dev, scratch, . . .


The simple Email action already has an option to send Email Addresses (comma-separated) and use vairables is there a way to do that here?

Alternatively, is there a way to add people in the cc contacts without the data being hardcoded? Currently, when adding the Assignment the Value field only takes constants. It doesn’t seem to work with Record (Single) Variables, Collection Variables or Variables. 

Shawna Richardson

are there any workarounds to add an image to the text template? I did read that the image insert isn’t working, I’m assuming this is still the case as I’m unable to get it to work.

Jack Pond

I have never been able to get the text template working with images. HOWEVER, I have had MUCH better luck using the Lightning EmailTemplate. Might just mean I’m not smart enough or there’s some trick, but the new Lightning EmailTemplate makes it a piece of cake.

Shawna Richardson

Unfortunately I need to merge fields from objects other than lead and/or contact, so I don’t think this will work for me because I can’t figure out how to merge fields from opportunities.

Jack Pond

I can’t get this to post an image here, but opportunity is one of the pull-down options in the Email Template Related Entity Type field.

Last edited 3 months ago by Jack Pond
Shawna Richardson

on the lighting email template? The only related entity field options I have are contact/lead. If I’m using the this package, I can pull in oppty fields but can’t get an image to display.

Aleksandar Basic

For more objects, you’ll need to enable enhanced email in setup.

Shawna Richardson

What’s weird is in the image above for his example for rich text he shows an image.

Alex Edelstein

The problem here is that you can insert an image but it doesn’t get properly extracted from the Text Template and converted to HTML. It also doesn’t properly get packaged for use in Change Sets. On our list to fix.

Lisa Mensink

I have a question about the HTML Body functionality. I would like to create a dynamic email “template” using flow, where the field from a new Lead displays in the “follow-up email” only if there is some data in the field. Empty fields do not display in the email.   I want the labelled lines with field data in the email to be separated by <br> tags, as I am adding the fields one by one with flow logic and need to add each one on a new line. Can I create a text variable with HTML tags in it,… Read more »

Jack D. Pond

Lisa, you piqued my curiosity. Copied (Send HTML Email Testflow) and saved as a new flow (TestForLisa). I added the following formula(
“<H1>This is a test</H1><br/>UserID: “+{!UserIdRunningFlow}+”<br/><p>Thank you!</p>”
that incorporated yet another formula: {!UserIdRunningFlow} which is basically nothing more than {!User.Id}
I then modified the Action to use this formula and turned off the plaint text body.
Got the following results in the email (Properly formatted, just can’t show that here):
This is a test
UserID: 0059A000002QSdY
Thank you!
Was this what you were looking for?

Last edited 3 months ago by Jack Pond
Lisa Mensink

If it turns out properly formatted, using the tags, I’m all set! (Your comment above wasn’t able to show a new line when it was tagged as such, but obviously it was not showing the tags in the result.)   Just before reading your comment I had just installed the managed package (confusing, since “Winter 20” is under “Old Versions” and I was looking for a “current” version) to try it out myself. I am not seeing the new “Send HTML Email” option (shown in the video) when I try to create a new Action. When I try to create… Read more »

Jack Pond

Lisa, I would recommend:
1.33.1 Unmanaged sendHTMLEmail (with Flow Examples/Tests) – Minor update Addresses issues #308 and #316 to fill in Task Comments and Recipients and improved documentation. You may have to manually uninstall the managed package first.

Last edited 3 months ago by Jack Pond
Lisa Mensink

Thanks for your help, got the package working. One more question: Is there a way to use a Public Group as the email recipient. OR is there a way to build a node into my Flow such that I can bring the members of my Public Group into, say, a collection variable, then loop through and string them together into a variable to put into the recipient field? I don’t want to hard code a list of recipients. This group is all over the place and I don’t want to hard code their emails and have to update everywhere. I… Read more »

Gidi Abramovich

Lisa Hi, I’ve created a Subflow that sends an email to the members of a specific Public Group (the admins Public Group). This way, I can reuse it whenever I like.   In order to create it, I’ve used only 2 elements: ‘ExecuteSOQL‘ Apex Action – Inside the ‘soqlQuary’ you need to add a Variable/Text Template with the query (such as: Select Email from User Where IsActive = true and Id IN (SELECT UserOrGroupId from GroupMember where Group.DeveloperName ='[Public Group API Name’)) Send HTML EmaiL– define the Subject and the Body, and add the Apex Action’s output in the ‘SendTOtheEmailAddressesFromThisCollectionOfUsers’… Read more »

Alex Edelstein
Lisa Mensink

Everything is working, and I now have the dynamic Lead follow-up email I’ve been wanting, displaying only the fields with content. I wrote my own flow loop through GroupMembers of the Public Group input to create a collection of email addresses to send the email to (wrote it before I saw your answer). Thanks for all your help and for this much-needed functionality that is allowing me to pare down proliferating workflow rules by using this dynamic flow functionality. Also thanks for your shout-out to this helpful site in your Release Readiness Live presentation! Looking forward to using the HTML… Read more »

Sujatha M

I get the following error message when I use the SendHTMLEmail : An Apex error occurred: SendHTMLEmail.InvocableActionException: SendEmail failed. First exception on row 0; first error: INSUFFICIENT_ACCESS_OR_READONLY, Not profiled to access this Org-wide Email Address: []
|FlowActionCall|SendHTMLTEmplate .. Is there a documentation for troubleshooting ?

Jack Pond

This is a permissions error on your Org-Wide Email address, which usually means whatever user is running the process doesn’t have access to that address – check your sharing. Which version are you using? (all > 1.3x.x use without sharing, so you shouldn’t be seeing this)

Chase Kaiser

Hi Jack, I am using version 1.33.1 and I am also receiving this error when trying to send from a scheduled flow.


Do you have a solution now? I’m facing same issue with “Without sharing ” class.

Gidi Abramovich

I’m looking for a way of sending an email to multiple recipients on Custom Object by using an Email Template.
Is there a way of doing it?

Jack Pond

Hey Gidi,   I know this is confusing and we are trying to make it less so in 1.33.2, but   1.33.1 Allows bulkification of sendHTMLEmail. You can loop through and send to each recipient using templateTargetObjectId(“Template Target Record Id”) you can add merge fields from the recordId(“Related Record ID(whatId/recordId)”). Note: the target id is the contact, lead, or user to which the email will be sent. The related record Id has the merge fields of your custom object of any of the following types: Account Asset Campaign Case Contract Opportunity Order Product Solution Custom   With Dev and Scratch Orgs… Read more »

Last edited 3 months ago by Jack Pond

Yeah, i’m hitting limits with this in a scheduled flow. I’m not using an email template, but a text template in the flow. Were you saying the action can handle more than 10 executions in a single run if I used an email template instead? I just need this to work for more than 10 different emails (with different attachments and different recipients) in one run

Jack Pond   10 per invocation is definitely the limit for SingleEmail Messaging (used in sendHTMLEmail 1.33.1), though if the request could be bulkified, theoretically could do 10 requests of 10   1.33.2 has both MassEmail and SingleEmail messaging, but adding that made the parameters so complex that realistically no one can understand it, so it hasn’t been released. Working on Custom Parameter Editor for Summer ’20 release, but I can’t figure out whether or not MassEmail is going to help limits through bulkification in either scenario (yet). Haven’t tested it in a prod environment, though I can tell you in… Read more »

Josh Dayment

I am using this action to send multiple emails to multiple recipients using a loop and a dummy action to overcome the 10 limit. In the screenshot I am taking a list of “candidates”(really community members/users) and sending each one an email using a template in this use case. The dummy action is just that its a dummy apex action that breaks up the look and the consecutive transaction to overcome the 10 emails per transaction since its a new transaction each time. You can also use a wait/pause in an autolaunched flow to do the same thing.

Last edited 1 month ago by Jack Pond
Josh Dayment


Jack Pond

Now THAT is a brilliant workaround. Thanks for posting – been noodling this one for a while!

Gidi Abramovich

Jack Hi,
Thank you for your answer, but I’m still confused 🙁
I want to send an email to a group of recipients while using merging fields from a custom objects’ Email Template.
I can create a Record Collection that will include my recipients information, but how can I use it?
As per my understanding, the ‘Template Target Record Id’ can be a Contact, Lead, or User.
Regarding ‘Related Record ID(whatId/recordId)’ – it says that I need to add a Contact.
So how this can be achieved?

Jack Pond

If you want to use a Related Record Id, you also MUST use a Template Target Record Id. sendHTMLEmail was originally written to only send one message at a time. With that said, the only way you can do this right now is to specify a single templateTargetObjectId with a matching recordId(‘Related Record ID(whatId/recordId)’). For sending multiple messages with this flow, I would recommend you look at
Josh Dayment’s solution above (for now).

Gidi Abramovich

Thank you, Jack, for your answer.
I understand now that this is a limitation.
I have a different workaround since Josh’s solution looks a bit risky for my requirement since I need an activity to be created on each record.
So I am using a generic Flow template, without merging fields.
By the way, for those of you who are looking for an asynchronic solution – I think it is possible to use Mass Action Scheduler by Doug Ayers and limit the batch size to 1.

Last edited 3 months ago by Gidi Abramovich
erik lopez

I love the idea of this action and am very close to implementing it. However, ever time I send my email template, and add the related to record Id, I get this error:
Error Occurred: An Apex error occurred: SendHTMLEmail.InvocableActionException: SendEmail failed. First exception on row 0; first error: INVALID_ID_FIELD, WhatId is not available for sending emails to UserIds.: [whatId, 0062900000BpWYX]
the Target Id field I am using is the opportunity owner and the related Id field is for the opportunity that started my flow. How do I resolve this?

Jack Pond

This component uses. This has the following limitation:
If you specify a contact for the targetObjectId field, you can specify a whatId as well. This field helps to further ensure that merge fields in the template contain the correct data. The value must be one of the following types:

  • Account
  • Asset
  • Campaign
  • Case
  • Contract
  • Opportunity
  • Order
  • Product
  • Solution
  • Custom

The message is a platform error message (not a component error message). It seems to intimate that you cannot add a related record (WhatId) if you are sending to a UserId. I will look into this, but it kinda caught me unaware too.

Last edited 3 months ago by Jack Pond
erik lopez

Oh! So if I understand what you are saying correctly, if I specify a contact (maybe a dummy Id or something) this then should work with the opportunity I put in the whatid/recordid space? Ill give that a go! Thanks for the quick reply, Jack!

Jack Pond

Great attitude Erik!
That’s why we love SF. There’s usually a workaround once we find why it isn’t working. Formula field workarounds are often helpful too.

erik lopez

Jack! That totally worked! I put in a dummy contact id in there and I was able to go ahead and send out my html email. However, it is weird that I can’t send the HTML email to my opportunity owner by specifying that in the TargetObjectId field. Weird. But thanks for helping me puzzle that out!

Micah Perry

Where did you put this dummy contact Id? I’m running into the same issue and I can’t resolve it.   I have my custom object record in “Related Record ID(whatId/recordId)”   I have “saveAsActivity” set to False.   I have “Template Target Record Id” set to my custom object created By User Id   And I have “templateID” set to my email template record Id.   I continue to get the error message:   “Error Occurred: An Apex error occurred: SendHTMLEmail.InvocableActionException: SendEmail failed. First exception on row 0; first error: INVALID_ID_FIELD, WhatId is not available for sending emails to UserIds.:… Read more »

Jack Pond

We ran into this over the weekend. Though it is not documented anywhere I could find, apparently you cannot use a Related Record ID(whatId/recordId) if your ‘Template Target Record Id’ is a User. See the above chain for a workaround.

erik lopez

The other issue I am running into is when I use a lightning template. When I specify my template as a lightning template, I get this error:   SENDHTMLEMAIL (APEX): Notify_BP_Contacts Inputs: recordId = {!Get_Current_Opportunity.Id} (0062900000BpWYXAA3) saveAsActivity = false SendCCthisStringCollectionOfEmailAddresses = {!collectedEmailAddress} ([]) SendTOtheEmailAddressesFromThisCollectionOfContacts = {!Get_All_Contacts_That_Can_Be_BP_Notified} ([Contact (0032900000WSnsOAAT)]) SendTOthisOneEmailAddress = templateTargetObjectId = 0032900000WSnsOAAT templateID = 00X29000000F2GAEA0 Error Occurred: An Apex error occurred: SendHTMLEmail.InvocableActionException: SendEmail failed. First exception on row 0; first error: UNKNOWN_EXCEPTION, We don’t recognize the field prefix Account. Ensure that you are using an associated record when sending the email.: []   Am I using the right… Read more »

Jack Pond

Same type of problem as above, different field (targetObjectId):
Required if using a template, optional otherwise. The ID of the contact, lead, or user to which the email will be sent. The ID you specify sets the context and ensures that merge fields in the template contain the correct data.

erik lopez

Ok Ill try a few more things out. As always, thanks Jack. I appreciate the response. This has been super helpful 🙂

Timothy Williams

I am trying to set up a simple email with attachments flow. I want to get the record, attach files, use a template, and send it based upon a criteria of status. I have tried, but I am not sure how. I looked at the examples, but I don’t see how they pull the attached documents from the record. Would appreciate any assistance.

Steven Hamilton

Hi guys, Great solution, thank you for making available to the community!   One issue I’m experiencing – it could be me, so apologies if it is!! However I don’t seem to be getting the attachments linked to the activity which is being created to log the email send. Is this expected?   I am receiving the attachments in the email itself, but I’d like this capturing against the activity as well. I have SFDC setup to send all files as attachments up to the SFDC limit – so this could be part of the behaviour, so could the activity… Read more »

Steven Hamilton

Thinking more about this, or at least return the ID of the activity that is created so I have the ability to update the task how I see fit…

Jack Pond

Great Idea – I’ll add the taskId (if any) to 1.33.2, Enhancement Issue #392.

Last edited 3 months ago by Jack Pond

[…] can provide Send Rich Email with a collection of Email addresses, but how do you get that information out of a Public Group? […]


It seems as though, with 1.33.01, I could pass in a null collection of Contacts to the TO SendTOtheEmailAddressesFromThisCollectionOfContacts along with a single email in the SendTOthisOneEmailAddress and the email would work most of the time. Sometimes our collection has Contacts and other times it is empty. With 1.33.1, it seems I can no longer pass a null collection. Is that confirmed, planned functionality? I am afraid doing a Decision node in Flow for each of the ‘send email’ actions (~20) would be unwanted and cluttering work, if the package could just check for null and ignore it if null.… Read more »

Jack Pond

I successfully ran a test with 1.33.2 which had valid subject, plain text body, SendTOthisOneEmailAddress, and SendTOtheEmailAddressesFromThisCollectionOfContacts = null
Email message was received. Could you run a debug and show me the debug output for SENDHTMLEMAIL with the failure conditions set? Thanks
How the Interview Started
Jack Pond (005R0000006cd7m) started the flow interview.
plainTextBody = Testing
SendTOtheEmailAddressesFromThisCollectionOfContacts = null
SendTOthisOneEmailAddress =
subject = Testing Null Contacts
templateUsed (null)
errors (null)
taskId (null)
isSuccess (true)


Thanks Jack, happy to … where/how do i install 1.33.2?

Jack Pond

Ryan, just run the same test with 1.33.1 – that part of the code wasn’t changed (I think).


The issue seems to be with 1.33.1 After I added contacts to the collection, it worked. Before, here was the error:
recordId = {!recordId} (a083C000003zT7fQAE)
plainTextBody = {!txt_introToListingAgent_buyerSide} (Hi…)
saveAsActivity = true
SendCCtheEmailAddressesFromThisCollectionOfUsers = {!colAgent_Users} ([User (0056A000001LSsIQAW)])
SendCCthisOneEmailAddress = {!Agent.Email} (phil@***.com)
SendCCthisStringCollectionOfEmailAddresses = {!listingAgentsCcList} (null)
SendTOtheEmailAddressesFromThisCollectionOfContacts = {!listingAgents} (null)
subject = {!txt_subject_Intro} (Congrats, We’re Under Contract!)
UseSalesforceSignature = {!c_useSignatureTF} (false)
Error Occurred: An Apex error occurred: System.NullPointerException: Attempt to de-reference a null object

Jack Pond

saveAsActivity = true, can’t save activity if no object. Is what’s causing the problem. Any ideas on how to remediate? something like check to see if any objects were specified, gotta noodle this one.   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.   After further looking at this, prior to 1.33.2, saveAsActivity conflated two different functionalities, the ability to save the email activity on the… Read more »

Last edited 3 months ago by Jack Pond

Thanks Jack. I have the Related Record ID(whatId/recordId) set to log the activity to the record that the flow is running on (i.e. recordId), which logs successfully, on the record when the flow finishes successfully, with at least one Contact in the SendTOtheEmailAddressesFromThisCollectionOfContacts. The email is not logged on the contact. But, if the SendTOtheEmailAddressesFromThisCollectionOfContacts is null, it doesn’t work, so it doesn’t seem related to the saveAsActivity.

Jack Pond

There’s a very simple way to test this. Could you Set saveAsActivity to false and see what you get?


Weird. Now it’s working with null collections (SaveAsActivity still TRUE). Sorry for the false alarm.

Jack Pond

NP, and that IS weird, but stuff like that happens to all of us. Working on 1.33.2 and will have it available ASAP.


I think this is just awesome! I haven’t tried all the functionality that comes with it but I just passed a list of emails and a rich text and work perfectly!!
Thank for all of this amazing tools for flows.


Just one thing. I set a list of contacts and the save Activity but received the following:
Error Occurred: Unable to convert value ‘Tue Jun 16 18:20:58 GMT 2020’ to Apex type Datetime for Apex action SendHTMLEmail field Contact.LastModifiedDate
Assuming I need either whatIds or TemplateIds right?
Thank you guys!!

Jack Pond

Hey Paulina, you got me on the “unable to convert time”, and frankly I’m a little awed you got there. Could you do me a favor and run this in debug mode and copy the results before and after you hit the sendHTMLEmail action? If you are using saveActivity you MUST also use ‘Related Record ID(whatId/recordId)’. This is because we conflated Email Activities and Task Activities with Email in <1.33.1 – and (since I’m not close enough for you to hit me with anything you could throw), the separation won’t be fixed until 1.33.2. In the mean time, if you… Read more »


I will and let you know! i just saw this, not getting notification sorry. I am testing this again in another sandbox and I will debug the code to see what might be the problem. Just so you know that maybe will give some idea, we are using CEST but I don’t think that might make a difference.


I’m getting this error also – Still a bit confused as to what the problem is here?

contentDocumentAttachments = {!get_CDL} ([ContentDocumentLink (06A3t000006uIrgEAE),ContentDocumentLink (06A3t000006uIrfEAE)])
HTMLbody = {!Email_Body_Text} (XXXXXXXXXX)
recordId = {!brand.Id} (0013t00001UwpV4AAJ)
saveAsActivity = true
SendTOtheEmailAddressesFromThisCollectionOfContacts = {!coll_Recipients} ([Contact (0033t000032yegfAAA)])
subject = XXXXXX {!Snapshot_Date} (XXXXX June, 2020)
UseSalesforceSignature = true

Error Occurred: Unable to convert value 'Wed Jul 29 16:26:40 GMT 2020' to Apex type Datetime for Apex action SendHTMLEmail field Contact.LastModifiedDate
Last edited 2 months ago by Rowan

How can I manage to install the package in my sandbox?


Copy the URL link for the install and change the ‘login’ at the beginning to ‘test’ and then login with your sandbox creds.

Jack Pond

Serge, when logging in for installation, you may also have to choose “Log In with a Different Username” in the login, then “Use Custom Domain” and enter the URL of your sandbox.

Last edited 3 months ago by Jack Pond

Hi Jack,

I think I have missed something on installing/setting up the unmanaged package, but for some reason the body of the email template doesn’t populate in a test email.

  1. run flow: Send HTML Email Testflow (also tested own version)
  2. select option 4 (send email template)
  3. input Template Id, lead record id in targetobjectid, send display name and subject

All information pulls through apart from the body in the received email. Have I missed something obvious?

Could you assist please?

Alex Edelstein

I believe the Body field of the Send Rich Email action will overwrite the body content of your template if it has a value, so make sure it doesn’t, if you want the template’s body to be used.

[…] discussed in the Email Templates section of the Send Rich Email action, Salesforce Lightning Email Templates have an ability to merge data in dynamically, but […]

Bobby K

I am using v1.33.1 and can’t get attachments into the apex action using old school attachments. V1.2 mentioned attachments support, but my collection variable with attachment records is not available for selection unless I change it to a record variable rather than a collection. Any idea why that could be the case?

Jack Pond

Bobby K, today has been a blur for me – will try and look at this tomorrow, but if you’d like to dig a little deeper yourself, I would start looking at the requirement that attachments need to be CDL (Content Document Links), as passed in contentDocumentAttachments. The attachment example in the test flows would be a good place to look at how that is done.

Bobby K

Hi Jack – thanks for the quick response! I think I am just misunderstanding the capabilities…Attachments from the old Notes & Attachments wouldn’t have CDLs (I don’t think). I guess this is extra motivation to go through the conversion over to Files. Thanks!


The emails I’ve sent doesn’t appear as activity in the related record page. Anyone else got troubles with it? :/

Alia Burdick

Hi there! Such a great resource. Implementing for my first solution and have a question on the ActivitySave parameter. When I set this to TRUE it appears that 3 different tasks are getting created for each email send (I am also leverage Classic email templates). Task 1: One of the activities has the Subject “Sent Email: [merge fields from subject line on template] … ex: Sent Email : {!advpm__Matter__c.Loan_Number__c} – {!advpm__Matter__c.Name_of_Borrower__c} to recipient(s):“ There is no additional data saved in the task and the status is Open so it is appearing in my Upcoming and Overdue task list. Its… Read more »

John M

Jack P, we are getting two tasks created, Task 1 and Task 2 in Alicia’s comment. Task 1 for us has status Closed, but is probably Open at some point as users are getting Task Completion update reminders for these.

Can we get Task 1 removed completely? It is redundant to the more informative Task 2 that has the email contents.

Edit: To be clear, Task 2 is actually the Message Activity entry, not a Task. I will test with options to see what is produced in different configs.

Last edited 3 months ago by John M
Jack Pond

There are multiple issues that require addressing on this. Specifically, sendHTMLEmail – Separate Email Activity from Email Task Activity The Class development work has already be done and is available in, but the new parameters are undocumented, and, frankly, to complex to be meaningfully useful. I think I’m going to take a couple days off work and get this done. This keeps popping up, but is dependent on sendHTMLEmail CPE For Summer ’20 Release , which I have not done yet.

Last edited 3 months ago by Jack Pond
Joel McDonald

Just adding my a comment to say I just ran into the same issue where a sent email is logged, but an open task is also created.

Jennifer Sanchez

Love this! And very helpful documentation!! Just installed and configured yesterday and I am trying to send 4) Email Using Template – An email using a Lightning EmailTemplate. There are no errors, email sends and logs an activity to the related record. My only issue is that the body of the email is blank? The LE email template is related to a contact and an opportunity. I can manually send it from SFDC but through the flow the body displays blank. Even when I send through the screen test flow, the body is blank. Am I missing something? besides part of… Read more »

Jack Pond

Jennifer, have you checked to make sure HTML Body and Plain Text parameters are both null, and that you (or the effective user when running the flow) have access to the opportunity you are using as your relatedto record? (and there’s nothing wrong with your brain – I think we’ve all run into this one)

Last edited 3 months ago by Jack Pond
Jennifer Sanchez

Hi there, thanks for your reply! HTML Body and Plain Text parameters are both null and the flow is running in system access to all data, and I am sys admin with full permissions. So it works in prod and does not work in sandbox. The main difference is that sandbox is summer 20. I am using SendHTMLEmail version 1.33.1. Is this the latest version? or any issues with summer 20? Thank you!

Jack Pond

Jennifer, development for 1.33.1 was done on Summer ’20, and the scratch orgs don’t seem to be having this issue. HOWEVER, these are the type of anomalies that sometimes come back to haunt us, so if you find out why (or even if always) this issue is arising, please drop a note. Have you tried enabling Enhanced Email on the sandbox? (Settings–>Enhanced Email)

Jennifer Sanchez

Hi Jack, the issue was related to setting the subject line in the component and already having the subject line set in the email template. Apex seems to not know what to do with it and sends a blank email. So lessoned learned, don’t set the subject line if you are sending and html email template. And thanks for your help! This was annoying to figure out. lol!

Jack Pond

Jennifer, THANKS! Will consider adding a check to see if subject line in both places. Worst case, you’ve helped others figure out how to fix. Thank you!

Jennifer Sanchez

Never mind. I figured it out. The issue is related to sandbox. There must be some setting preventing the email body to display. I just tested in prod and it works as expected.


Hi Jennifer, I’m having the same problem except in Production the email is blank and in the sandbox is works fine. I’ve tried with and without the email subject.

[…] how you can use community built flow actions – in this post, we will use the Send Rich Email (Send HTML Email Action) – to enhance the power of flow from […]

Paul Carass

Hey Alex, I have tried to utilize this Action in a Field Service Flow. It works fine when I’m debugging on desktop, but as soon as I test it on the Field Service Mobile App, I am getting an error on the screen (See Attachement) stating that “Access to entity ‘ContentDocumentLink’ denied” What’s strange is that I’m not referencing any Content Document Links in my flow. The only place where the option to, is on this email action, and that is turned off. I had tried putting a global constant of ‘False‘ into that area, but that’s not even supported.… Read more »

Alex Edelstein

Field Service Flows can’t run Flow Actions at all, unfortunately. (

You can work around this by breaking things into two parts. Use the Field Service Mobile flow to create a custom record that stores the content, or references to the content, that you want to email. Then use the new Record-Change Triggered Flow type in Summer ’20 to trigger whenever one of these records is created, and call Send Email there.

Paul Carass

Thanks Alex. That’s cool.
I ended up splitting it into two parts. The Field Service Flow is creating a Product Transfer record. So the piece at the end of my FSL Flow with the Send HTMl Email, I migrated to a standalone auto-launched flow, fired off by Process Builder upon creation of a Product Transfer Record.

Have you much involvement with the Field Service Flow product?
Do you foresee it coming on par with standard flows in the near future? It seems to have so many limitations.

Elad Asulin

Hi guys, thanks for a magnificent package!

I am having issues including email templates. I have tried to use both classic and lightning email templates with no luck whatsoever. No matter what I do I get output template null result. I am including it here. any ideas?

SENDHTMLEMAIL (APEX): Send_Email_To_Patient
contentDocumentAttachments = {!Get_CDLs_0} ([ContentDocumentLink (06A4H00000HcAVTUA3)])
recordId = {!Get_Contact_Id.Account.Id} (0014H00002f7Av2QAE)
replyEmailAddress =
senderDisplayName = Tali Test
SendTOthisOneEmailAddress = {!Get_Contact_Id.Email} (
subject = Nerivio Test
templateTargetObjectId = {!varContactId} (0034H00002G0g6EQAR)
templateID = 00X4H000002OyHEUA0
templateUsed (null)
errors (null)
isSuccess (true)

Jennifer Sanchez

Don’t include the subject line. I ran into the same issue. See comments above from Jennifer Sanchez.

Elad Asulin

Thank you Jennifer you are a life saver!


I notice 1.33.2 has been talked about for a month or so, and I am eager to try it due to issues with earlier versions. Is there a time that is set to be available?

Jack Pond

“Are we there yet”? This update is huge. Should be coming out any day now.


GAH … don’t tease us!

Bill Fox

I do not use SF account, contacts or leads, when the “get records” is for “account” could I just as well get a custom object and use {{{}}} around the fields I want merged into a template from the custom object?


Does this component works with VisualForce templates?

Sam Mera

I am finding that regardless of how Save as Activity is set I get both a email message and an open activity saved. If I turn this off I get neither. Ideally I just want the completed email messages to show.

Sam Mera

The app seems to log an email message and an activity – is there a way to set it to just log the email message?

Gidi Abramovich

Did you try to set the Save as activity to false?

Lucas M Felman

Hi all,
Would anyone know what this error is caused from?
Error element Send_New_Business_Email (FlowActionCall).
The number of results does not match the number of interviews that were executed in a single bulk execution request.”
This happens when I try mass update Opportunity records which trigger my flow to send an email. I am only able to update one record at a time.


I ran the debug for my flow and I got an error “Error element Send_Email (FlowActionCall).
The “Send_Email” element in your flow has validation errors.” I didn’t receive an error email. Is there another way to figure out what it might be? I’m not creating any records in the flow.

Jack Pond

You may find it helpful to replicate this using “Debug” in the flow. That will give you a full log trace on the right hand panel. Another tip is to capture the error messages as part of the output and see what’s causing the error there.


I am curious about two things:

  1. waiting for 1.33.2 for hopes it fixes some oddities for us. Any timeframe on that?
  2. it seems the process is saving both an email record and a Task as activities. Can I turn off the addition of the Task and just keep the email log?
Jack Pond

Ryan, 1.33.2 Beta is in its final stages and hopefully will be released very shortly – we’re still doing some testing and the documentation has to be updated.

re: 2, in 1.33.2, Save Activity and Save Task have been separated. You will be able to select either or both (subject to the limitations the Message class).

Sam Mera

I have installed the app and it works really well however I get 2 records created, the outgoing email message and an open task. How can we prevent the task being made but keep the email?

Chris Oriel

Just a tip for anyone using the 1.2 version to work with attachments (not Files). In my use case, I will only ever have 1 attachment, but the component is built to accept multiple attachments in a collection variable and does not seem to accept a single record variable. Once I converted my Get Records earlier in my flow to populate a collection variable with my single Attachment record, it worked.

Last edited 1 month ago by Chris Oriel
Trevore Meyer

This is amazingly helpful! Thank you! I’m getting stuck with two things right now though. First, and I can’t for the life of me figure out why, but the flow is sending two identical emails to the record (I’m only using the single email address right now) The second is trying to relate an email to the activity history for a Lead. I’ve seen some documentation indicating that we can’t do this, but if I were to “SendEmail” right from the record itself or link an email from Gmail, those both work for Activity History purposes. Any thoughts/ideas on these… Read more »

Trevore Meyer

I didn’t realize there were lots of comments from before. For the activity history on the lead, I think I’ll just create the task and close it to achieve the same effect.

Still am a bit stuck on the email duplication, however.
Figured out the duplication! My flow was set to run on Record created or edited. Adjusted it to created and it’s only iterating one time which is what I’m looking for.

Last edited 1 month ago by Trevore Meyer
Erin Heffner

This package has been extremely helpful! Thank you for making it available. I am testing the send an email using a Lightning template functionality. I have it working, but when I click the Finish button on the flow, the email sends again. Do you have any suggestions as to why this would be happening?

James Allen

Any update on the 1.33.2 release? I am hitting the 10 singleEmailMessage limit. I understand the complexity of the parameters for mass email, but if you could at least release a beta version of it or something we could use it for mass email and give feedback for the flow interface with the parameters.

Jack Pond

James, you will never get more than 10 if you are using a scratch org, and never more than 10 per transaction unless you use Josh’s solution (above) that makes the process flow think that every time it exercises a dummy flow, a new transaction starts. HOWEVER, you can put multiple addresses in either a single or mass email posting (up to 150), so (if you’re in a production org), you may not see these limits.


Is there a limit to how many recipients can be in the SendTOthisStringCollectionOfEmailAddresses collection?

Jack Pond

The maximum size for this field is 4,000 bytes. The maximum total of toAddresses, ccAddresses, and bccAddresses per email is 150. All recipients in these three fields count against the limit for email sent using Apex or the API.

Benjamin Beggs

What kind of “Special Arrangements” would I make in my org to get the email to appear as a verified sender instead of of behalf of…. We use Office 365. I simply using this to send some scheduled reports to employees and executives, but it gets flagged and sent the “other” or quarantine inbox. By using the org-wide email it doesn’t get quarantined, but it still doesn’t look like its coming from me or is a from a recognizable sender.


You need to setup Organization-Wide Addresses in Salesforce, where you can customize the sender name and email address. Once verified, you can use the addressId to send as any of the org wide addresses you had pre configured.