I use the same email template for more than one alert or process. Is it possible to capture the id or name of the triggering Flow, workflow rule, or process definition in the email message? This would help trouble shooting. Thanks
1 Answer
Given that the email body includes some reference to the target object (a Case, an Opportunity, etc.) ...
Historically, what I would do is have the Process Builder or Flow write a Task under the email alert's target object with:
- Subject:
Myprocess/MyFlow initiated email - Status:
Completed - OwnerId: Running user's Id
- DueDate: TODAY()
There's no runtime context for the Email Message beyond the available merge fields such as $User, $Profile, etc.
An alternative would be for the Flow or Process Builder to update a field in the target object (Last_Used_Automation__c) that is referenced as a merge field in the email message.
- I'd avoid this due to slower processing (extra DML and in some case, the recursive Save process)