Difference between revisions of "SendMailTemplateFromResource"

From Catglobe Wiki
Jump to: navigation, search
(Tag: visualeditor)
Line 1: Line 1:
 
{{HelpFiles}}
 
{{HelpFiles}}
  
==== sendMailTemplateFromResource<br/> ====
+
==== sendMailTemplateFromResource ====
  
 
send mail by an existing mail template
 
send mail by an existing mail template
Line 7: Line 7:
 
'''Syntax'''
 
'''Syntax'''
  
sendMailTemplateFromResource(number parentResourceId, string email, string alias, number mailTemplateId [, string fromEmail ] [, callback function(subject, message)]);
+
sendMailTemplateFromResource(number parentResourceId, string email, string alias, number mailTemplateId [, fromEmail ] [, callback function(subject, message)]);
  
 
'''Arguments'''
 
'''Arguments'''
Line 19: Line 19:
 
''mailTemplateId'': Is an expression of the type number. It is Id of the mail template
 
''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.
+
''fromEmail'': Is an expression of the type string or EmailAccount. It is from email address.
  
 
''callback function(subject, message)'': Use to update mail when sending.
 
''callback function(subject, message)'': Use to update mail when sending.
Line 31: Line 31:
 
sendMailTemplateFromResource(15546533,"an@maysunshine.vn","An",1378);
 
sendMailTemplateFromResource(15546533,"an@maysunshine.vn","An",1378);
 
</source>
 
</source>
<br/><source lang="javascript">
+
<br /><source lang="javascript">
 
string firstName = "An";
 
string firstName = "An";
 
string today = "2016-25-11";
 
string today = "2016-25-11";

Revision as of 09:41, 29 May 2018


sendMailTemplateFromResource

send mail by an existing mail template

Syntax

sendMailTemplateFromResource(number parentResourceId, string email, string alias, number mailTemplateId [, 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 or EmailAccount. It is from email address.

callback function(subject, message): 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