0

I have setup a custome object (Test WF) with default "Owner" and custom "Status" field. My aim is to trigger mail whenever "status" field is "Assigned", hence setup workflow rule with rule "Test WF: Status equals Assigned" and included email alert in immediate action on workflow. Below is the visualforce email template I am using.

<messaging:emailTemplate subject="WF EMail Test" recipientType="User" relatedToType="Test_WF__c">
<messaging:plainTextEmailBody >

Dear {!recipient.Name},

</messaging:plainTextEmailBody>
</messaging:emailTemplate>

Now if a user "Person 1" is creating the "Test WF" record, owner will be set to "Person 1". After this if "Person 2" will change the status field to "Assigned", an email will be triggered to "Person 1" like below.

Dear Person 2,

"Person 1" is getting this email containing text "Dear Person 2". Please note "to" and "from" email addresses are correct. I am facing issue here, why I am getting "Person 2" in the solutation even though it is sent to "Person 1" from "Person 2"?

Please help!!

4

1 回答 1

0

开始创建一个新的(纯文本)电子邮件模板,然后使用合并字段下拉菜单。

"Sending User fields" -> {!User.Name} etc.
"Receiving User fields" -> {!Receiving_User.Name}

您应该也可以在 VF 电子邮件模板中使用这些,而不仅仅是纯文本/html/信头邮件模板。

当您在审批过程中使用电子邮件时会更有趣,您可以使用 {!ApprovalRequest.Process_Assignee} 等;)

在部署之前进行试验并确保它按预期工作。不匹配的合并字段将只是空白。

于 2012-10-26T22:57:16.690 回答