Run Mail Script in Email Template?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-17-2016 08:45 AM
I have to be doing something wrong that someone will see here.
Here is my scenario: A user receives a notification from ServiceNow and has the option to click on a mailto link to send back and kick off an inbound action, similar to the approval emails. I want a the new email to popup with prefilled Subject/Body but I also need to include an email in the CC. I wrote a mail script to add the CC email address. I am calling it in the email template but it just prints the variable and doesn't run. I put in another variable and it seems to work fine. I checked the source code and there isn't any funky HTML happening around it. Can we not call mail scripts in the email templates? If not, what are my options? Much appreciated!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-17-2016 07:55 PM
Thanks Deepak. I do have a mail script that is setting the mailto: properties, which does work well. How are you getting the reply to as the instance email address or are you not doing that? I got distracted with some other tasks and ended up not finishing the script to call out the instance. I'll try to write that on Monday.
Thank you for taking the time to reply!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-17-2016 08:03 PM
Hi Cheri,
email.setReplyTo("ReplyTo@domain.com"); // will set the reply to email address for mail getting generated via servicenow, the moment user click on reply in outlook
email.setFrom("emailFrom@domain.com"); // will set the from email address for mail from servicenow, this actually changes the from address on email header
template.print("<a HREF=mailto:linkReplyTo@xyz.com?subject=Re:" +current.sysapproval.getDisplayValue() +"-approve>Click here to approve the request custom </a>");
template.print("<a HREF=mailto:linkReplyTo@xyz.com?subject=Re:" +current.sysapproval.getDisplayValue() +"-reject>Click here to reject the request custom </a>"); // this will auto populate reply to email address as "linkReplyTo@xyz.com" for email link embeded in email, just like "approve or reject" links
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2016 06:08 AM
Unless I am misunderstanding you, that doesn't create the correct email address on the email you are sending back to ServiceNow. I don't want to hard code support@domain.com because if I have testers go in Test and it will send it to Prod instead of Test, etc. Your first two lines just create the replyTo on the original notification, which already has the correct email address. Thank you for your input!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2017 08:58 AM
I just stumbled on my own question here. My solution was when the inbound action was received it triggers an event that sends a notification to the CC groups. It's working great for us. I suppose it's a couple extra pieces but it wasn't worth the time to make this work all in one piece without hard coding something that would also have to be maintained between instances.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-30-2020 01:08 AM
I am facing the same issue. Any fix for this? I am in Madrid and using gmail for replies.