Setting Subject in Mail Script for Email Client Template

pardhiv
Tera Contributor

Can we set a subject in Mail Script for Email Client Template (sys_email_client_template) . Tried below

 

pardhiv_0-1666330935104.png

 

 

 

 

pardhiv_1-1666330956480.png

 

 

12 REPLIES 12

You can do in a single template  and subject line will get selected as per condition match, but be careful with condition what you select should match and keep a default one as well.

Thanks

Do you mean Script in Subject Field ?Can you please share a sample  ?

You can pass array in param2 and manipulate subject on the basis of that 

=========================
(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {

// Add your code here
var data_=event.parm2.split(',');
for (var i = 0; i < data_.length; i++) {
if (data_[0]=='condition-1') {
email.subject ="subject-1";
} else ....so on

})(current, template, email, email_action, event);

This is from Client email template , you said that it cant be scripted in email script ?

I would create different Quick messages and then have the condition on those, so it can only be chosen by the specific groups etc. 


Best regards,
Sebastian Laursen