7

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

2 Answers 2

6

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}

1
  • Welcome to SFSE Adelchi. I've just edited the qustion to show what's expected when posting a link for an answer, hope this helps!
    – Matt Lacey
    Commented Jan 15, 2015 at 23:39
4

For anyone coming to this page with a similar question but due to Changed Password / Reset Password inside an Experience Site not properly merging in the recipient fields, here's what I did: Create a User lookup field on Contact and set to be the Contact's User when the Contact's user is created. Then construct your Visualforce Email Templates to leverage the Contact as the recipient. You can merge in Language: language="{!recipient.User__r.LanguageLocaleKey}">

and Username {!recipient.User__r.Username}

2
  • @identigral sadly, that is not the correct format for VisualForce Email templates. That is the format for Text and HTML. Commented Oct 18, 2022 at 17:04
  • You're correct, was reading too fast. VF templates are "special".
    – identigral
    Commented Oct 18, 2022 at 17:08

You must log in to answer this question.

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