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 08:01 AM
Go to Email Notification Script and click on it_leadership_discussion Email Notification Script and write this block.
email.setReplyTo("joe.employee@yourcompany.com");
Hope this Helps.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-17-2016 08:17 AM
Hi Prasun,
Thank you for your response!
I tried adding the email.setReplyTo in the email template that I am using the notification but it just added the string to the body of the email and not in the To field. Is this how it should be added or how?
Also, this is what I have in the email notification that is using the email template.
Thank you for your help!
Yeny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-17-2016 09:09 AM
No, not in the template.
GO to Notification Email Script and select it_leadership_discussion script. In there add the script.
Remove additional setReplyTo
What I think, two blocks of setReplyTo is conflicting. better use
script:
(function runMailScript(current, template, email, email_action, event) {
email.setReplyTo("yeny.doe@nrg.com");
})(current, template, email, email_action, event);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-17-2016 10:28 AM
Thank you Prasun,
Hmm, I tried that but still nothing. How would I be able to tie the mailto:mailto:ITLeadershipDiscussion to the notification email script though?
Yeny