I am using a demo account of Docusign integrating with force.com sites using Apex. I created a template and want to send two different mail body to two different recipient. I have two roles Agent and Broker. In Broker mail body I want to use Agent Recipient Name. I can get the name in subject by using [[Agent_UserName]] but not in body. Is there any way to use Merge fields in Mail body.
Asked
Active
Viewed 331 times
1 Answers
3
Merge fields are not supported in the email Body.
Here is a sample CreateEnvelope request to send unique Email Subject/Body per recipient. You will have to add the emailNotification property for each recipient
{
"status": "created",
"compositeTemplates": [
{
"inlineTemplates": [
{
"sequence": "1",
"recipients": {
"signers": [
{
"name": "recipient one",
"email": "recipientone@acme.com",
"routingOrder": "1",
"recipientId" : "1",
"roleName" : "texter",
"tabs": {
"textTabs" : [
{
"xPosition" : "100", "yPosition" : "100", "documentId" : "1","pageNumber" : "1"
}
]
},
"emailNotification": {
"emailSubject": "subject for one",
"emailBody": "Body for One",
"supportedLanguage": "en"
}
},
{
"name": "Jane Doe",
"email": "janedoe@acme.com",
"routingOrder": "2",
"recipientId" : "2",
"roleName" : "signer",
"tabs": {
"signHereTabs" : [
{
"xPosition" : "100", "yPosition" : "200", "documentId" : "1", "pageNumber" : "1"
}
]
},
"emailNotification": {
"emailSubject": "subject for two",
"emailBody": "Body for two",
"supportedLanguage": "en"
}
}
]
},
"documents": [
{
"documentId": "1",
"name": "Contract",
"fileExtension": "txt",
"documentBase64": "RG9jIFRXTyBUV08gVFdP"
}
]
}
]
}
]
}

Praveen Reddy
- 7,295
- 2
- 21
- 43