[SalesForce] Email Alert Triggered in Scheduled flow has blank merge fields for Custom fields Only

A Scheduled Flow sends an email alert. The ID and Name fields show up in the email alert, but the other merge (custom) fields do not.

The email alert fired other means works as desired.
The Automated Process. I assume it is a permissions issue for the automated process users profile…or the fields specifically.

But I can't seem to access the custom objects via the process outlined here
Automated Process User Profile Permissions

So I made a permission set and granted the access that way…

/setup/layout/flsedit.jsp?id={autoproc_profile_id}&type={sObjectName}

I also tried to assign read to the custom object fields in the field level security for the automated process user…
/setup/layout/flsdetail.jsp?id={autoproc_profile_id}&type={sObjectId}

but the merge fields for custom fields remain blank when the scheduled flow sends the email alert.

Update:
The issue appears to only affect Visualforce.
Using an HTML Template the merge fields are populated.

Best Answer

Sadly, using VF emails do not work when merge fields are used and the context user is Automated Process.

Workarounds:

  1. Use text or HTML emails
  2. Use a VF email component with its own component controller; you'll need to grant explicit access to the component controller's Apex class to Automated Process user as this does not occur by default (see - Automated Process User Profile Permissions) - If you need a merge field in the subject line .. this won't help

Known Issues:

Related SFSE posts on same topic

Related Topic