- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2022 12:42 PM
I am writing a script include.
I am trying to add the Address of the user who created the request. How do I add the sys_created_by or sys_id email of the person who created the request?
if(current.getValue('u_drop_off') == '1' {
var dropOff = gs.getProperty('Location');
email.addAddress(dropOff);
email.addAddress(EMAIL OF THE USER WHO CREATED REQUEST);
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2022 01:34 PM
If you want to send email to the requester, in the User/Group in fields, you can select the field which holds the user value.
If you want to send email with user in CC, you can use script
if(current.getValue('u_drop_off') == '1' {
var dropOff = gs.getProperty('Location');
email.addAddress('cc',dropOff);
email.addAddress('cc',current.requested_for.email);
}
Can you also confirm, your notification is on sc_request table?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2022 02:35 PM
I have an existing notification and script include. For my story I am just adding additional functionalities.
I created a new system property(dropOff) and applied the email in the value.
Next I add my script :
if(current.getValue('u_drop_off') == '1' {
var dropOff = gs.getProperty('Location');
email.addAddress('cc', dropOff);
email.addAddress('cc', current.EMAIL OF THE USER WHO CREATED REQUEST.email);
}
This should trigger the cc'd when the dropOff value is 1.
Currently I am getting the dropOff cc'd when i check the email logs in the backend.
I am not able to figure out how to dynamically cc'd the person who triggers the request.
So far ive tried:
current.caller_id.email
current.sys_created_by.email
current.user_name.email
None of the above has work and many has returned 'undefined'
current.requested_for.email
current.send_self.email (after going to the notification table to find out what element was 'send to create')
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2022 02:46 PM
Can you tell me the table name where the notification is configured for this email script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2022 02:53 PM
sysevent_email_action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2022 03:06 PM
No. The notification or email is running on which table?
Could you please send a screenshot of the notification where you are calling the email script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2022 06:12 AM
I am unable to access the community on that computer. But the table us u_dropoff_request table and where you showed me I could bring over (requested for +)
On my end I am seeing (dropoff +) so I brought that over and created by.
I even tried dot walking by doing email.addAddress('cc', current.dropoff.created_by.email); or email.addAddress('cc', current.dropoff.email); and its not reading.