EmailTemplate TemplateGetAllFromParent
Revision as of 10:10, 27 October 2016 by Tranvuthaibinh (talk | contribs) (Created page with "Category:Email_and_SMS_Functions {{HelpFiles}} ==== EmailTemplate_TemplateGetAllFromParent ==== Return an array containing all email templates An array which contains e...")
EmailTemplate_TemplateGetAllFromParent
Return an array containing all email templates
An array which contains email templates objects. for infomation click here;
Syntax
EmailTemplate_TemplateGetAllFromParent(parentResourceId);
Arguments
- parentResourceId: is number. It is parent resource id where contains email templates
Return value
array
Examples
EmailTemplate email = new EmailTemplate(15537524);
number parentRsId = email.ParentResourceId;
array emailTemplates=EmailTemplate_TemplateGetAllFromParent(parentRsId);
for(number i=0;i< emailTemplates.Count;i++)
{
print(emailTemplates[i].CreatedDate);
print(emailTemplates[i].ModifiedDate);
print(emailTemplates[i].ObjectTypeName);
print(emailTemplates[i].ParentResourceId);
print(emailTemplates[i].ResourceId);
print(emailTemplates[i].ParentResourceId);
print(emailTemplates[i].SubjectDefaultLanguage);
if(i==emailTemplates.Count-1){
emailTemplates[i].SubjectDefaultLanguage = "SUBTEST";
emailTemplates[i].Save();
print(emailTemplates[i].SubjectDefaultLanguage);
}
print("==============================");
}
//result:
2016-03-24 02:25:18
2016-03-24 02:36:43
EmailTemplate
15532172
15532546
15532172
Invitation til undersøgelse
==============================
2016-05-31 03:05:25
2016-05-31 03:09:38
EmailTemplate
15532172
15537524
15532172
Invitation til undersøgelse
==============================
2016-10-26 03:57:45
2016-10-27 08:54:55
EmailTemplate
15532172
15544386
15532172
SubNew
SUBTEST
==============================