[SalesForce] How to get the approver name into an HTML email

This should be pretty easy but it's giving me bouts of grief.

I need to get the name of the person that approved a record into an HTML email template, as there are several possible approvers and they would all like to know which one approved the record from an email sent on final approval/rejection, rather than logging into Salesforce (for various reasons – they'd like to know via email they hardly ever log into Salesforce).

I tried using the LastModifiedBy name, which seems to be correct when I look at an approved record in the UI, but when I insert it in my email template as a field, it's blank (or the record owner) when the approval/rejection takes place; this is disappointing because the Last ModifiedBy, when I look at the record in the SFDC UI is the actual approver.

Any ideas on how I can accomplish this?

Thanks in advance.

Best Answer

You can use the Merge field {!ApprovalRequest.Process_Approver} .

This field will initially have the Submitter when the Approval Request is sent. And then it gets populated with the Subsequent Approvers after each step.

Check this knowledge Article on how to use the Approval Merge Fields and also go thru the Considerations to understand when the Merge fields will work

I haven't tested this, but based on this Known Issue it seems the Merge fields are not being populated correctly.

If the standard Approval Merge fields are not working for you, as a possible workaround you can capture the User Approving the request into a custom field using a Workflow field update and then use that Custom field in your email template.

Related Topic