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
SunilSunil 

How to use mail merge using sControl

Hi,
 
I have 50 mail merge templates with different details. Based on state, it should select particular mail merge template. I want to write a sControl which can select particular mail merge template based on state.
 
How can I do this sControl?
 
Thanks in advance.
 
 
 
 
 
 


Message Edited by Sunil on 03-20-2008 02:46 AM
NareshNaresh
Hi Sunil,

The code given below can help you to resolve the problem

/******************************
var massRequest = new sforce.MassEmailMessage();
contactIDArray[0]= contactID;
massRequest.targetObjectIds = contactIDArray;
massRequest.replyTo = replyTo;
massRequest.subject = 'RE:'+ '{!Case.Subject}';
massRequest.templateId = templateId;
mailRequest[0]=massRequest;
var sendMailRes =  sforce.connection.sendEmail(mailRequest);

/*****************************************************************

where contactID is the target ids where we need to send the email and templete id is the ID of your template.

Thanks