email script for signature [Please see description]

snow34
Tera Contributor

I want to give signature at the footer as pe assignment group f

For example: If assignment group is abc then signature of abc assignment group should be there 

1 ACCEPTED SOLUTION

You need to create signatures in notification email scripts for each assignment group. you can take below reference.

(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
    /* Optional EmailOutbound */
    email, /* Optional GlideRecord */ email_action,
    /* Optional GlideRecord */
    event) {


    var group1_name = "Grpup1_name";
    var group1_sys_id = "group1_sys_id";
    var group1_description = "Group1 description";

    var group2_name = group2_name;
    var group2_sys_id = "group2_sys_id";
    var group2_description = "Group2 description";



    if (group1_sys_id == current.assignment_group) { // add Group1 - email signature

        template.print("Thanks and Regards," + "<br />" +
            group1_name + "<br />" +
            group1_description + "<br />");
		
    } else if (group2_sys_id == current.assignment_group) { // add Group1 - email signature

        template.print("Best Regards," + "<br />" +
            group2_name + "<br />" +
            group2_description + "<br />");
    }



})(current, template, email, email_action, event);

 

Thanks!

Sagar Pagar

The world works with ServiceNow

View solution in original post

12 REPLIES 12

It will print dynamic signature based on assignment group. You need to click the Email option in form header.

find_real_file.png

 

Thanks!

Sagar Pagar

The world works with ServiceNow

but for every assignment there is different signature how i will i achieve that ?

You can refer @Sagar pagar 's Script.

	template.print(logged_user.getValue("name")+'\n'); // this will print the logged in users name dynamically
	template.print(current.assignment_group.getDisplayValue()+'\n'); //this will print the assignment group dynamically.

You can also modify above script according to your requirement.

If you need more information on the email templates then please check below video.

Email Templates in ServiceNow

but every group have their customized signature 

snow34
Tera Contributor

this script is printing assignment group name in the signature but they have their customized signature how to achieve this