- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-05-2016 12:29 PM
Hi All,
Please help I am looking to add a cc box in an email notification but I can't seem to locate how to do this. I see a bunch of things in the community but it appears that it all involves scripting. Is there anyway around this?
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-05-2016 06:52 PM
That is definitely doable, too. So, rather than putting in an address and name manually, you can reference a field/variable from the table.
So, you could do something like this to send a CC to the manager of the current assignment group on an incident email:
email.addAddress("cc", current.assignment_group.manager.email, current.assignment_group.manager.name);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2017 04:48 PM
I have tried this ten different ways and my CC always shows up undefined. My log statements are showing the user name and email correctly. Any thoughts?
(function runMailScript(current, template, email, email_action, event) {
var pro = current.u_provisioner;
gs.log("Provisioner is " + pro);
var proinfo = new GlideRecord('sys_user');
proinfo.addQuery('sys_id', pro);
proinfo.addQuery("notification", 2);
proinfo.addQuery("email", "!=", "");
proinfo.query();
gs.log("Provisioner email is " + pro.email + " name is " + pro.getDisplayValue());
gs.log("pro name " + current.provisioner.name + " email " + current.provisioner.email);
email.setReplyTo(current.u_provisioner.name+' <'+current.u_provisioner.email+'>');
email.setFrom(current.u_provisioner.name+' <'+current.u_provisioner.email+'>');
email.addAddress("cc", proinfo.getDisplayValue(), proinfo.email);
})(current, template, email, email_action, event);
thank you,
Stacy
