You need to sign in to do that
Don't have an account?
pchal
Send Email using EmailTemplate with letterhead information
Please help me how to to send an email using EmailTemplate with letterhead information? Am I missing something here.
'targetObjectId' - sets the context and ensures that merge fields in the template contain the correct data.
'templateId' - The ID of the template to be merged to create this email.
//create single email message
var request = new sforce.SingleEmailMessage();
//set id
request.targetObjectId = id;
//set email template id
request.templateId = emailTemplateId;
//send email
var result = sforce.connection.sendEmail([request]);
if (!result[0].getBoolean("success")) {
throw(result[0]);
}
1. If I am sending a template mail to a list of USERS, I cannot supply a list of Opportunities with which the template will populate itself.
2. There seems to be a way to do this if I was trying to send to CONTACTS, however I have to provide 2 arrays. First is a list of contacts and the second a same length array of opportunity IDs, where each contact gets only 1 email.
Ideally I would be able to provide an Array of USERS and a second "any length" array of Opportunity IDs, where every user gets 1 a mail about each opportunity that I have passed in.
Doesn't seem like this is possible right now, which means that using an email template is not possible.
Anyone worked around this somehow?
I'm bumping this thread because 2 years later, this is still an issue. Simple use case: