You need to sign in to do that
Don't have an account?
devNut!
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="http://schemas.xmlsoap.org/soap/envelope/" xmlns="urn:partner.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<result>
<errors>
<fields xsi:nil="true"/>
<message>
When a template is specified the plain text body, html body and subject may not be specified
</message>
<statusCode>
INVALID_FIELD_WHEN_USING_TEMPLATE
</statusCode>
<targetObjectId xsi:nil="true"/>
</errors>
<success>
false
</success>
</result>
</sendEmailResponse>
SendEmail -SingleEmailMessage -> INVALID_FIELD_WHEN_USING_TEMPLATE
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="http://schemas.xmlsoap.org/soap/envelope/" xmlns="urn:partner.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<result>
<errors>
<fields xsi:nil="true"/>
<message>
When a template is specified the plain text body, html body and subject may not be specified
</message>
<statusCode>
INVALID_FIELD_WHEN_USING_TEMPLATE
</statusCode>
<targetObjectId xsi:nil="true"/>
</errors>
<success>
false
</success>
</result>
</sendEmailResponse>
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.