-->

How to Set Email Subject Line and Email Message fr

2019-08-04 12:39发布

问题:

Could anyone explain to me that how to set email subject line and email message using JSON in Docusign.

Note:(JSON string has to be passed as HTTP request).

Thank you, Vignesh.B

回答1:

Use the emailNotification property to set separate email subject and email body per each individual recipient. The emailNotification property should be set per recipient.

Here is a sample Json for the createEnvelope request.

POST /v2/accounts/{accountId}/envelopes

{
  "recipients": {
    "signers": [
      {
        "email": "recipientone@acme.com",
        "name": "recipient one",
        "recipientId": "1",
        "routingOrder": "1",
        "emailNotification": {
              "emailSubject": "Please sign the  document Recipient One ",
              "emailBody": "Hello Recipient One,\r\n\r\nYour consultant has sent you a new document to view and sign.  Please click on the View Documents link below, review the content, and sign the document.  If you have any questions, please contact your consultant.\r\n\r\nThank you!",
              "supportedLanguage": "en"
         },
        "tabs": {"signHereTabs": [{"documentId": "1", "pageNumber": "1", "xPosition": "100", "yPosition": "100"}]}
      },
      {
        "email": "recipienttwo@acme.com",
        "name": "recipient two",
        "recipientId": "2",
        "routingOrder": "2",
        "emailNotification": {
              "emailSubject": "Please sign the  document Recipient Two ",
              "emailBody": "Hello Recipient Two,\r\n\r\nYour consultant has sent you a new document to view and sign.  Please click on the View Documents link below, review the content, and sign the document.  If you have any questions, please contact your consultant.\r\n\r\nThank you!",
              "supportedLanguage": "en"
         },        
        "tabs": {"signHereTabs": [{"documentId": "1", "pageNumber": "1", "xPosition": "100", "yPosition": "200"}]}
      }
    ]
  },
  "documents": [
    {
      "documentBase64": "RG9jIFRXTyBUV08gVFdP",
      "documentId": "1",
      "fileExtension": "txt",
      "name": "Simple Contract",
      "order": "1"
    }
  ],
  "status": "Sent"
}


回答2:

Use the emailSubject and emailBlurb properties to set the subject and message for all the recipients in the envelope. These properties have to be set at the root level of your json request.

Note: You can override the properties at the envelope level by specifying the emailNotification property for each recipient as suggested in this answer

Here is a sample Json for the createEnvelope request.

POST /v2/accounts/{accountId}/envelopes

{
 "emailSubject": "Email subject for all recipients",
 "emailBlurb": "Email body for all recipients",
 "status": "Sent",
 "recipients": {
     "signers": [
         {
             "email": "recipientone@acme.com",
             "name": "recipientone",
             "recipientId": "1",
             "routingOrder": "1",
             "tabs": { "signHereTabs": [ { "documentId": "1", "pageNumber": "1", "xPosition": "100", "yPosition": "100" } ] }

         },
         {
             "email": "recipienttwo@acme.com",
             "name": "recipient two",
             "recipientId": "2",
             "routingOrder": "1",
             "tabs": { "signHereTabs": [ { "documentId": "1", "pageNumber": "1", "xPosition": "100", "yPosition": "200" } ] }
         }
     ]
 },
 "documents": [
     {
         "documentBase64": "RG9jIFRXTyBUV08gVFdP",
         "documentId": "1",
         "fileExtension": "txt",
         "name": "Simple Contract",
         "order": "1"
     }
 ]
}


标签: docusignapi