0

Question

How can I add the first name of a user email recipient to a text email template?

Background

I'm building an approval email template. The same template is used for various approvers which are stored in different lookups on the approval object (i.e. Object__c.Approver1__c, Object__c.Approver2__c), which means I can't just do {!Object__c.Approver1__r.FirstName}. Additionally the template needs to be editable by non-technical users, so I don't want to use visualforce templates, so I can't do {!Recipient.FirstName}.

I'd thought for sure there was an analogue of {!Recipient.FirstName} or {!User.Firstname} (which uses the current user's first name) for text email templates, but nothing is showing up in the list of merge fields. Am I missing something obvious?

1

Well you do have access to the ApprovalRequest merge fields, but they have limitations that preclude you from doing what you need:

Merge fields in the approval request email are set to the submitter's name and the name of the first step.

When the request is approved, the merge fields update to the most recent approver's name and the name of the second step, if applicable.

For subsequent actions, merge field values are updated based on the previous completed step.

Not sure there is an email-based workaround, but in your case, since you have approver fields on your custom object, you could have a field that is updated via the approval process to indicate its current step in the process, and then another formula field that, based on the step value, returns the current approver's name.

  • Are the ApprovalRequest merge fields listed somewhere? Not having much luck googling them and they don't show up in the list of available merge fields in the template editor ... – Ralph Callaway Apr 16 '13 at 5:56
  • Available in the standard email template editor under "Approval Fields" (i.imgur.com/LzalVvJ.png) – jkraybill Apr 16 '13 at 6:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.