More actions
Nguyenduyan (talk | contribs) Created page with "{{HelpFiles}} ==== sendMailTemplateFromResource<br/> ==== send mail by an existing mail template '''Syntax''' sendMailTemplateFromResource(number parentResourceId, string ..." |
No edit summary |
||
(9 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
[Will obsolete soon and replace by [[EmailTemplate_send|EmailTemplate_send]]. More detail at [[ConversionMethods|ConversionMethods]] ] | |||
==== sendMailTemplateFromResource | ==== sendMailTemplateFromResource ==== | ||
send mail by an existing mail template | send mail by an existing mail template, don't need qas context | ||
'''Syntax''' | '''Syntax''' | ||
sendMailTemplateFromResource(number parentResourceId, string email, string alias, number mailTemplateId [, | sendMailTemplateFromResource(number parentResourceId, string email, string alias, number mailTemplateId [, fromEmail ] [, callback function(subject, message)]); | ||
'''Arguments''' | '''Arguments''' | ||
parentResourceId: Is an expression of the type number. It is Resource Id of resource that contain these mail in communication tab after sending. | ''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. | ''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 | ''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 | ''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 class|EmailAccount]]. It is from email address. | ||
''callback function(subject, message)'': Use to update mail when sending. | |||
'''Return type''' | '''Return type''' | ||
Line 27: | Line 27: | ||
Empty | Empty | ||
'''Examples''' <source lang="javascript"> | '''Examples''' | ||
sendMailTemplateFromResource(15546533, | <source lang="javascript"> | ||
</source><br/><source lang="javascript"> | sendMailTemplateFromResource(15546533,emailAddress, alias,1378); | ||
string firstName = | </source> | ||
string today = | <br /><source lang="javascript"> | ||
sendMailTemplateFromResource( | string firstName=firstNameValue; | ||
string today= todayValue; | |||
sendMailTemplateFromResource(parentRId,emailAddress, alias, mailTemplatateId, fromEmail,function(string subject, string message ){ | |||
subject = stringReplace(subject,"[Date]",today); | subject = stringReplace(subject,"[Date]",today); | ||
message = stringReplace(message,"[firstName]",firstName); | message = stringReplace(message,"[firstName]",firstName); | ||
Line 38: | Line 40: | ||
}); | }); | ||
</source> '''Availability''' Version 6.0 | </source> | ||
'''Availability''' Version 6.0 | |||
[[Category:Email_and_SMS_Functions]] | [[Category:Email_and_SMS_Functions]] |
Latest revision as of 02:26, 13 May 2022
[Will obsolete soon and replace by EmailTemplate_send. More detail at ConversionMethods ]
sendMailTemplateFromResource
send mail by an existing mail template, don't need qas context
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,emailAddress, alias,1378);
string firstName=firstNameValue;
string today= todayValue;
sendMailTemplateFromResource(parentRId,emailAddress, alias, mailTemplatateId, fromEmail,function(string subject, string message ){
subject = stringReplace(subject,"[Date]",today);
message = stringReplace(message,"[firstName]",firstName);
return {subject,message};
});
Availability Version 6.0