[SalesForce] Salesforce Visualforce Email Template {!Recipient.Name} does not have the correct value

I have an object called 'Request'. This object has three lookup fields 'Reviewer 1', 'Reviewer 2', 'Reviewer 3' (User object); besides other non-relevant fields.

I have created a Workflow rule, which specifies that when a request is created send out an email to all reviewers.

I have used VF email template so that I can send other information regarding Response's child object. The email template is something like

<messaging:emailTemplate subject="test" recipientType="User" relatedToType="Request__c" >
    <messaging:plainTextEmailBody >
        Dear {!recipient.name},       
        ....
    </messaging:plainTextEmailBody>
</messaging:emailTemplate>

When an email is being sent out to reviewer, I get the name of the submitter(one who created the request), instead of the respective names of the recipient.

i.e. the email has "Dear Creator Name" for all the emails instead of "Dear Reviewer 1", "Dear Reviewer 2" and "Dear Reviewer 3" for the respective reviewers.

I think I have configured something incorrectly, please guide me on how I can fix this. Any help would be highly appreciated.

Many Thanks

Best Answer

I have found this known issue, it seems appropriate:

https://success.salesforce.com/issues_view?id=a1p30000000SdBfAAK

There is a work-around which is to use the relationship from the relatedTo record:

Use {!relatedTo..name}

So maybe try (guessing the lookup field API name):

{!Request__c.Reviewer_1__r.Name}

Related Topic