How to create Dynamic Subject of email client Template?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-07-2020 04:36 PM
I want to set the subject of my email client template:-
I created an email script and used:-
email.setSubject('');
and called the email script with tag ${mail_script:'name od email script'} in the body of the template.
But the value of the subject is not populating.
Please help!!!!!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-14-2021 09:39 AM
Hi,
I just wanted to check in on this. If my reply above helped guide you correctly, please mark it as Helpful & Correct.
Thank you!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-08-2020 02:30 PM
So you have the date/time field and you only want the date from the field. If my understanding is correct then you can do that by using getDate() function. Please find the snipped below for reference:
Please refer to the below link for more details and functions of GlideDateTime:
Also, I believe the invoke of email script was resolved with the previous reply from Sachin, Allen and me. Since, that's the only issue while invoking the email script in your syntax. It should be ${mail_script:name od email script}
Kindly mark my answer as Correct and helpful based on the Impact.
Regards,
Alok

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-08-2020 02:31 AM
Hi Adarsh Singh,
to set the subject of email client template:
${number} - ${short_description}
has to be a variable on the table
Mark as Helpful if solve your issue.
-Ali
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-14-2021 08:59 AM
(function runMailScript(current, template, email, email_action, event) {
email.subject = 'My subject';
})(current, template, email, email_action, event);
works for me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2022 08:20 AM
Well, as email object is not supported within Email Client Templates - the only way, I was able to achieve expected result, was calculated variable on the table I was using for it. In my case - used for Major Incident Communication tasks, so my String variable was on [incident_alert_task] table. Worked well.