- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2015 02:30 AM
I've created a new table. When the state field changes to 'sent' an email should be sent. Everything works fine, but not the 'from'-email address.
I want to send out the email from the user who has updated the record. The reply address should be always the same.
In the 'What will it contain' section of the definition in both the subject field and the message field the ${xyz} notation works, but not in the 'from' field. It looks the 'from' field is just a string field. No mechanism works on it to pass the required address ... Any idea?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2015 12:01 AM
Leave the from and reply to fields blank
Create a new 'Notification email script' say email_from having following code
email.setFrom(current.user.email);
email.setReplyTo(current.user.email); //please review for backend name of updated by 'user' field
Now call this notification script from the notification's Message HTML field as follow
${mail_script:email_from}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2015 12:01 AM
Leave the from and reply to fields blank
Create a new 'Notification email script' say email_from having following code
email.setFrom(current.user.email);
email.setReplyTo(current.user.email); //please review for backend name of updated by 'user' field
Now call this notification script from the notification's Message HTML field as follow
${mail_script:email_from}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2015 12:48 AM
Thank you Gurpreet Singh ! Thats the solution!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2020 06:20 AM
Hello Gurpreet,
I see update by field is a string field , how should i dot walk to get the email.
Please let me know .
Thanks,
Amar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2020 08:21 AM
There are multiple ways. GlideRecord the user table and fetch his email address.
1. You could pass the email as event parameter from Bossiness rule
2. If notification is not event based than you possibly need to write GlideRecord code in email notification script
https://developer.servicenow.com/dev.do#!/learn/learning-plans/orlando/new_to_servicenow/app_store_learnv2_automatingapps_orlando_notification_email_scripts