- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2018 03:16 AM
Hello everyone,
Currently I'm facing a problem where I define a notification like this:
Then I use a mailscript to dynamically change the from address and the reply to address:
I get this when I trigger the notification:
So I can see that mail script works because the subject is replaced, but the from address / reply to, is not modified when in the notification there is a value in those fields, ready the wiki: https://docs.servicenow.com/bundle/kingston-servicenow-platform/page/script/server-scripting/reference/r_MailScriptAPI.html
In the Mail api it says
setFrom(String address):
override the sender address.
So I was expecting this to work, I know that if in the notification we don't have anything set in the from/reply to this mail script works fine, would like to know your thoughts.
Cheers,
Diogo
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2018 03:20 AM
I found that if you have hard set the from and to address on the notification it will use those details regardless of any mail scripts you have running. If you remove those values the notification will automatically use the instance address or whatever one you have set up as your from address in your SMTP email account, then you can molest it with mail scripts.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2018 03:20 AM
I found that if you have hard set the from and to address on the notification it will use those details regardless of any mail scripts you have running. If you remove those values the notification will automatically use the instance address or whatever one you have set up as your from address in your SMTP email account, then you can molest it with mail scripts.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2018 03:24 AM
Yeah I found that also, just think that maybe the Wiki could be more explicit when they say "override".
Cheers for the answer.
Diogo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2018 03:43 AM
Yeah agreed, a little note about that in the docs would be useful. If you're question is now answered please mark my answer correct to close the thread down.
Cheers
Dave