How to add a 'setReplyTo' (EmailOutbound method) in an email template?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-17-2016 07:57 AM
Hi,
In the approval request email that an approver receives when an item is submitted contains the 'Click here to approve' and 'Click here to reject' links. When the approver clicks on any of those links, an email is opened up for that user to reply. What I am trying to do is to add a third link called 'Click here to start a discussion' and would like to populate the 'To' field in the email with specific email addresses to send to. I have tried using an email script in an email template but it is not working as expected.
Can someone please give me some ideas as to how I can resolve this issue? I'm stuck at this point and would really appreciate any ideas. Please see the below screen shots that show what I've done.
email script:
Name:it_leadership_discussion
script:
(function runMailScript(current, template, email, email_action, event) {
email.setReplyTo("yeny.doe@nrg.com");
email.setReplyTo("jane.doe@nrg.com");
})(current, template, email, email_action, event);
email template:
Name: mailto.ITLeadershipDiscussion
Subject: Re:${sysapproval} - ITLeadershipDiscussion
Message:
Click here to start a discussion ${sysapproval}
${mail_script:it_leadership_discussion}
This is a preview of the email that is sent out to the approvers:
Unfortunately, what I get in the email when I click on the link to reply to start a discussion is this:
I've also tried adding the 'setReplyTo' directly in the template and didn't work either.
Any ideas would be so much appreciated!!
- Labels:
-
Service Mapping

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-17-2016 10:49 AM
So my case is to be able to provide the users receiving an email with a link to click on called "Click here to start a discussion" so a new email opens up in their email client. The TO address bar in the email automatically defaults to the systems address (myinstance@service-now.com) but in addition to that, i want to populate other users. For example, the TO address bar should say myinstance@service-now.com;jane.doe@company.com;joe.employee@company.com.
That's why I am using is a notification email script to collect the email.setReplyTo() users and then, I'm calling that script from the mailto.ITLeadershipDiscussion. Then I am using that template in the actual notification that is sent to the approvers by using mailto:mailto.ITLeadershipDiscussion which is the 3rd link that they see.
I'm just not having any luck with this... any ideas on your end?