Add group member in CC using mail script while autopopulating email
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2024 09:35 AM
Hi,
I have used email template in order to auto-populate the content once the user clicks on the link. But I want to add group members in cc. is it possible using email template? (note: I am not using email client template)
as the first line in email template appears as link and any text after that gets autopopulated in reply email. is it any possible way to add email scipt which will add cc in reply email?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2024 10:23 AM
Please post your current email script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2024 01:58 PM
Hi @UjwalaBedarkar ,
You can write a email script and call that script in the message html part,
email_script:
(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */
email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */
event) {
var grp = new GlideRecord('sys_user_grmember');
grp.addQuery('group', current.assignment_group);
grp.query();
while (grp.next()) {
email.addAddress("cc",grp.user.email.toString(),grp.user.name.toString());
//gs.info('email '+grp.user.email);
}
})(current, template, email, email_action, event);
Email Template:
Result:
Please mark this comment as Correct Answer/Helpful if it helped you.
Regards,
Swathi Sarang