- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-01-2024 10:56 PM
Hello All,
I need to set email receipients dynamically from a system property...I have stored email address in the system property
and I want to set them as email recipients using email script.....I am using below code...but it's not working
could anyone suggest me what can be the mistake here?
Email script calling in the notification-
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-01-2024 11:27 PM
why not include recipient in event parm1 and then combine what you want to send as 1 piece in json in event parm2?
you can define your own json structure for event parm2 and use the same while parsing in email script
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-01-2024 11:05 PM
you cannot set the recipients via email script. Only CC and BCC is allowed.
why not have this code where you are using eventQueue based approach and set the recipients from there?
If you are not using eventQueue approach then use that and you can use the recipients from system property
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-01-2024 11:16 PM - edited ‎02-01-2024 11:16 PM
Hello @Ankur Bawiskar ,
Thank you for your response on this....I am using the eventQueue based approach but already passing two important parameters ....I don't think I can add one more...or can I ?
below is my code-
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-01-2024 11:27 PM
why not include recipient in event parm1 and then combine what you want to send as 1 piece in json in event parm2?
you can define your own json structure for event parm2 and use the same while parsing in email script
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-01-2024 11:37 PM
Hi @Utkarsha
You can not set To email via email script, on cc and bcc can be set, please send the To recipient email id via an event
Regards,
Piyush Sain