- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2022 08:07 AM
Hi all,
I have a custom field on [Walk-up Appointment] that holds an alternate email address.
I would like to see if we could input the field into a notification, so it sends directly to the email address field, either through the Notification object or by script.
Thank you.
Solved! Go to Solution.
- Labels:
-
Notifications

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2022 10:15 AM
Hi,
You can use mail script to achieve this. Please refer to documentation such as: https://docs.servicenow.com/bundle/rome-servicenow-platform/page/script/server-scripting/reference/r...
So you'd create a mail script using, example:
email.addAddress("cc",current.email_field);
or
email.addAddress("bcc",current.email_field);
Then in the notification body you can use:
${mail_script:name_of_mail_script}
You're unable to use mail script for the "to" field, but you can use an event and pass the email address as parm1 or parm2 and then use that in your notification.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2022 10:15 AM
Hi,
You can use mail script to achieve this. Please refer to documentation such as: https://docs.servicenow.com/bundle/rome-servicenow-platform/page/script/server-scripting/reference/r...
So you'd create a mail script using, example:
email.addAddress("cc",current.email_field);
or
email.addAddress("bcc",current.email_field);
Then in the notification body you can use:
${mail_script:name_of_mail_script}
You're unable to use mail script for the "to" field, but you can use an event and pass the email address as parm1 or parm2 and then use that in your notification.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2022 11:10 AM
Hi Allen,
Thank you for the solution. As for the event solution, could you explain more how that could be put in place? Would it require Business Rules to trigger the event?
Thank you.
Vikki

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2022 11:41 AM
Hello,
Doesn't necessarily need a business rule for it to fire, but you could do that. I don't know the specifics on "when" you want the notification to send, but you would need to determine that on your end. You could then use an onAfter business rule that if the condition 'x' is met, you fire the event:
and then you'd pass that field's value as parm1 (refer to documentation above), for exmaple.
Then in the notification, you'd change it from firing how it is now and instead choose "when event triggered" and select your newly created event that you'll make for this process. Then in the "who to send to" tab, you'd select "parm1 contains recipients" because you've now set it up to include that email value in your parm1.
Please mark reply as Helpful, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2024 12:53 AM
hi,
thanks a lot.
it works, but why 'to' does not work?
email.addAddress("to",current.email_field);