Here is the code for sending an email via template using C# code
SendEmailFromTemplateRequest emailUsingTemplateReq = new SendEmailFromTemplateRequest
{
Target = entEmail,
// Template ID
TemplateId = entEmailTemplate.Id,
// The regarding Id is required, and must be of the same type as the Email Template.
RegardingId = erfRecord.Id,
RegardingType = Constants.OPPORTUNITY
};
// SendEmailFromTemplateRequest creates one more email for sending. So deleting the email created initially.
service.Delete(Constants.EMAIL, entEmail.Id);
--
Happy CRM'ing
Gopinath
SendEmailFromTemplateRequest emailUsingTemplateReq = new SendEmailFromTemplateRequest
{
Target = entEmail,
// Template ID
TemplateId = entEmailTemplate.Id,
// The regarding Id is required, and must be of the same type as the Email Template.
RegardingId = erfRecord.Id,
RegardingType = Constants.OPPORTUNITY
};
// SendEmailFromTemplateRequest creates one more email for sending. So deleting the email created initially.
service.Delete(Constants.EMAIL, entEmail.Id);
--
Happy CRM'ing
Gopinath
No comments:
Post a Comment