Announcement : Email Template

C_S3
Tera Contributor

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!

1 ACCEPTED SOLUTION

Create a Notification Email Script as below

Screenshot 2023-07-03 at 5.27.46 PM.png

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}

View solution in original post

6 REPLIES 6

C_S3
Tera Contributor

Thank you for your help. It resolves my issue!

I am glad it helped.