Blog
Home/

Common API Tasks 🐈: Change email subject and body for each recipient

Inbar Gazit

Inbar Gazit

Sr. Manager, Developer Content

Summary2 min read

See code examples in six languages showcasing how to use the eSignature API to modify the email subject and body for each of the recipients on an envelope

    • C#
    • Java
    • Node.js
    • PHP
    • Python
    • Ruby
    • C#
    • Java
    • Node.js
    • PHP
    • Python
    • Ruby
    • Additional Resources
    Table of contents
    Common API Tasks

    Common API Tasks

    This post begins a new blog series called Common API Tasks, focusing on small useful API tasks. In each post, I'll detail a specific activity that is useful to many Docusign API developers and I'll show you how to complete that task easily. For this first post in the series, I chose customizing the content of the email message (both the subject line as well as the body of the message) that is sent to remote recipients when an envelope is routed for signature. I will even show you how to have custom emails for each of the recipients in your envelope.

    As most of you probably know, you can change the subject line of the email as well as the body of the email (what we call the blurb) for the entire envelope. You do that using the EnvelopeDefinition object. Here's how to modify the email subject and body of all recipients in an envelope:

    C#

    Java

    Node.js

    PHP

    Python

    Ruby

    While this is useful, there are cases where you may want to customize the message for each of the recipients in an envelope. You can actually do that with the Docusign eSignature API!

    When you add the recipients to your envelope, each recipient includes an optional RecipientEmailNotification object. This object includes the EmailSubject and EmailBody properties, which can be used to customize the email that is sent to the specified recipient only.

    (EmailBody, which was previously called blurb, is an additional text that is added at the beginning of the email message. It doesn’t refer to the entire body of the email message). Here is how to customize the subject and body for a specific recipient in various languages:

    C#

    Java

    Node.js

    PHP

    Python

    Ruby

    If you have multiple recipients, you can set a custom email subject and body for each of them separately using the code above. Recipients whose email subject and body are not specified will inherit the overall envelope email subject and body, so there’s no need to specify it if you wish to just use the same one that was set for the envelope.

    I hope you found this useful! I would love to get your feedback about this blog post. Feel free to email me at inbar.gazit@docusign.com with any questions.

    In the next blog post in this series, I’ll show how you can use the eSignature API to retrieve envelope data. Stay tuned...

    Additional Resources

    Inbar Gazit

    Inbar Gazit

    Sr. Manager, Developer Content

    More posts from this author

    Related posts