Toggle menu
862
3.8K
30.2K
279.1K
Catglobe Wiki
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

SendMailTemplateFromResource: Difference between revisions

From Catglobe Wiki
Nguyenduyan (talk | contribs)
No edit summary
Nguyenduyan (talk | contribs)
No edit summary
Line 27: Line 27:
Empty
Empty


'''Examples''' <source lang="javascript">
'''Examples'''  
<source lang="javascript">
sendMailTemplateFromResource(15546533,"[email protected]","An",1378);
sendMailTemplateFromResource(15546533,"[email protected]","An",1378);
</source><br/><source lang="javascript">
</source>
<br/><source lang="javascript">
string firstName = "An";
string firstName = "An";
string today = "2016-25-11";
string today = "2016-25-11";
Line 38: Line 40:
});
});


</source> '''Availability''' Version 6.0
</source>  
'''Availability''' Version 6.0
[[Category:Email_and_SMS_Functions]]

Revision as of 07:15, 13 December 2016


sendMailTemplateFromResource

send mail by an existing mail template

Syntax

sendMailTemplateFromResource(number parentResourceId, string email, string alias, number mailTemplateId [, string fromEmail ] [, callback function(subject, message)]);

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.

callback function(subject, message): Use to update mail when sending.

Return type

Empty

Examples

sendMailTemplateFromResource(15546533,"[email protected]","An",1378);


string firstName = "An";
string today = "2016-25-11";
sendMailTemplateFromResource(15546533,"[email protected]","An",1378,"[email protected]",function(string subject, string message ){
 subject = stringReplace(subject,"[Date]",today);
 message = stringReplace(message,"[firstName]",firstName);
 return {subject,message};
});

Availability Version 6.0