Skip to main content
Solved

Email Body Empty When Sending DocuSign Email via Apex Using Messaging.renderStoredEmailTemplate

  • January 15, 2026
  • 3 replies
  • 48 views

Forum|alt.badge.img+1

Hi, I am sending a DocuSign email from Apex and using the Salesforce Email Template to generate the Email Body. I am using Messaging.renderStoredEmailTemplate to get the HTML body, and when I check the result using System.debug the HTML content is correctly generated and present.

 

However, after the email is sent, the email body is completely blank.

 

Relevant Code:

Messaging.SingleEmailMessage renderResult = Messaging.renderStoredEmailTemplate(
opportunityEmailTemplateId, opportunityId_i, myContact.Id
);

String opportunityOfferEmailContent = renderResult.getHtmlBody();

myEnvelope = myEnvelope.withEmail(
opportunityOfferEmailSubject, //Subject
opportunityOfferEmailContent //Email Body
);

myEnvelope = dfsle.EnvelopeService.sendEnvelope(
myEnvelope,
true
);


How do I resolve this?

 

Kind Regards

Willy

Best answer by Islam.Hassanein

Hi ​@whaliim,

Docusign expects plain text content in the email body. Please ensure you use the plain text version or strip html to plain text.

String opportunityOfferEmailContent = renderResult.getPlainTextBody();



 

3 replies

Forum|alt.badge.img+6
  • Docusign Employee
  • Answer
  • January 19, 2026

Hi ​@whaliim,

Docusign expects plain text content in the email body. Please ensure you use the plain text version or strip html to plain text.

String opportunityOfferEmailContent = renderResult.getPlainTextBody();



 


Forum|alt.badge.img+6

Hi ​@whaliim,

Docusign expects plain text content in the email body. Please ensure you use the plain text version or strip html to plain text.

String opportunityOfferEmailContent = renderResult.getPlainTextBody();

 


Forum|alt.badge.img+12
  • Community Moderator
  • January 26, 2026

Hello ​@whaliim 

Thank you for reaching out here in Docusign Community.

I want to confirm if you need further assistance, feel free to let me know and I will gladly help you address the situation as soon as possible.

You may also open a case for further assistance and you may follow the steps provided in the link below on how to open a case.

Open a case in the Docusign Support Center

If you found the provided response to be a useful solution to your question, please mark it as the best answer by clicking “Select as Best” to make it easier for other users to find.

Best regards,
Marco | Docusign Community Moderator