- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-03-2023 04:00 AM
Hello Everyone,
I have an requirement, when someone is creating an announcement then email should be send. I have created one notification and one email template, both on announcement table. Now in the emails signature the name and title of should be visible who created the announcement.
I tried from the fields but its not working. when I take name and title, it pull up the data from announcement table. And when i tried created by in the place of name, it pulled up the used_id.
Any help would be appreciated. Thank you!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-03-2023 05:01 AM
Create a Notification Email Script as below
Pasting the piece of code here
var gr = new GlideRecord('sys_user');
gr.addQuery('user_name', current.sys_updated_by); // You can use sys_created_by as well
gr.addActiveQuery();
gr.query();
if (gr.next()) {
template.print('Name: ' + gr.name + '\nTitle: ' + gr.title);
}
Call this email script in you Notification body using the syntax
{$mail_script:getUserSignature}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-03-2023 10:34 PM
Thank you for your help. It resolves my issue!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-03-2023 10:57 PM
I am glad it helped.