- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2022 04:35 PM
Hi everyone,
I'm sending an email using a Script Include, in order to send it I'm just inserting a record in sys_email table with Type "send-ready". Then, after the record is inserted I attach a file to the record and ServiceNow sends the email automatically. The problem here is that I want to change the name of the sender. Is there a way to do it without using notifications, events and email templates?
Regards
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2022 05:08 PM
Hi, you could use a notification email script
email.setFrom(“AnyName <” + dot.walktoemailaddress + “>”
https://docs.servicenow.com/bundle/sandiego-servicenow-platform/page/script/server-scripting/reference/r_MailScriptAPI.html
But trying a quick test and setting a 'From' field in a notification template,
this results in the value being pushed into sys_email.user when the notification is triggered.
So perhaps you can set the value of sys_email.user during your initial sys_email record insert, using a string with the format.
'a user name <an email address>'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2022 05:08 PM
Hi, you could use a notification email script
email.setFrom(“AnyName <” + dot.walktoemailaddress + “>”
https://docs.servicenow.com/bundle/sandiego-servicenow-platform/page/script/server-scripting/reference/r_MailScriptAPI.html
But trying a quick test and setting a 'From' field in a notification template,
this results in the value being pushed into sys_email.user when the notification is triggered.
So perhaps you can set the value of sys_email.user during your initial sys_email record insert, using a string with the format.
'a user name <an email address>'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2022 06:02 PM
It worked! I just filled the "User" field in sys_email with the alias and email address. Thanks!