Skip to main content
Question

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

  • January 15, 2026
  • 2 replies
  • 30 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

2 replies

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+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();