function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion


Why can't the plain text body and html body be specified when sending a SingleEmailMessage using a template through the API ?

The Salesforce UI allows a user to select a template and edit the email body before sending.

<sendEmailResponse xmlns:soapenv="" xmlns="" xmlns:xsi="">
      <fields xsi:nil="true"/>
        When a template is specified the plain text body, html body and subject may not be specified
      <targetObjectId xsi:nil="true"/>
I understand your point, but you can't possibly both use a template and make edits to the body in a single call.  I don't think you can do this right now via the API anyway but it would have to be 2 calls, one to resolve the template to a body and the second to actually send the email with that body.

I was hoping it would work that way.

Another problem that may cause this error is that for singlemail you are sending more than 10 mails in 1 go.