SendMailTemplateFromResource

From Catglobe Wiki
Revision as of 07:52, 25 November 2016 by Nguyenduyan (talk | contribs) (Created page with "{{HelpFiles}} ==== sendMailTemplateFromResource<br/> ==== send mail by an existing mail template '''Syntax''' sendMailTemplateFromResource(number parentResourceId, string ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


sendMailTemplateFromResource

send mail by an existing mail template

Syntax

sendMailTemplateFromResource(number parentResourceId, string email, string alias, number mailTemplateId [, string fromEmail ] [, all updateMail]);

Arguments

parentResourceId: Is an expression of the type number. It is Resource Id of resource that contain these mail in communication tab after sending.

email: Is an expression of the type string. It is email address of receiver.

alias: Is an expression of the type string. Alias of receiver

mailTemplateId: Is an expression of the type number. It is Id of the mail template

fromEmail: Is an expression of the type string. It is from email address.

updateMail: Is an expression of the type of any. Use to update mail when sending.

Return type

Empty

Examples

sendMailTemplateFromResource(15546533,"an@maysunshine.vn","An",1378);


string firstName = "An";
string today = "2016-25-11";
sendMailTemplateFromResource(15546533,"an@maysunshine.vn","An",1378,"antest@cghead.catglobe.com",function(string subject, string message ){
 subject = stringReplace(subject,"[Date]",today);
 message = stringReplace(message,"[firstName]",firstName);
 return {subject,message};
});

Availability Version 6.0