1

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.

2
  • 1
    this is a known issue with Automated Process context user and VF Email; we had to use html/text emails for this use case
    – cropredy
    Oct 19, 2020 at 18:26
  • Thanks for your reply, if you have the known issue reference/want to answer. I'll mark you ask the answer.
    – Gabriel M
    Oct 20, 2020 at 20:31

2 Answers 2

1

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

1
  • Thanks again :)
    – Gabriel M
    Oct 21, 2020 at 23:59
2

Don't know if anyone is following this one still but I had the same issue with a visualforce email template missing some merge fields values when sending an email alert via an scheduled-triggered flow. I solved it by:

  1. Adding the attribute, renderUsingSystemContextWithoutSharing="True", to the header of the Visualforce email template (e.g. <messaging:emailTemplate renderUsingSystemContextWithoutSharing="True" subject="blah blah" etc...)
  2. Following the steps outline in Automated Process User Profile Permissions

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .