Email Notification Action Override
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-26-2012 06:58 AM
I have an e-mail notification setup based on the sc_request table. The default value in the User_Field is to send the email to u_customer. For specific requested items I would like to override this field via script to send to requested_for. I see that I can get access to the user_field value via the email_action object. I have tried to override the value as follows, but it had no effect.
email_action.user_field = 'requested_for';
Please let me know how to override this action.
Thank you,
Don
- Labels:
-
Analytics and Reports
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-26-2012 08:45 PM
u can have a go from this i guess : https://wiki.servicenow.com/index.php?title=Scripting_for_Email_Notifications
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2012 04:59 AM
I did come across that article, however it only shows how to add "cc" and "bcc" recipients. According to the documentation the "addAddress" method does not accept a type value of "to".
addAddress(String type, String address, String displayname) - type can be "cc" or "bcc"
I need to override the "to" address, however there is no "setTo" method. I also tried the "setReplyTo" method but that did not work either.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2012 08:16 PM
well i tried that method for one of my work and it did work - so if possible cud u share the code
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-28-2012 05:36 AM
I have the user_field set to "u_customer", I want to override it to be "requested_for". I have tried the following two statements but neither work.
email_action.user_field = 'requested_for';
email.setReplyTo(current.requested_for.email);
Would you share the code you used to get it to work.