Signature template for reply All, reply and forward sent

Abhishree Sinha
Tera Contributor

Signature block should be included in email body when users click Reply, Forward, or Reply All to an email thread on the Activity Log for requests and matters inside Legal Counsel Center.

I created email script in legal request scope and also a client template. But when I click on reply All, I cannot see the signature on it. Though I can see it under email template. 

There is a replyAll client template in global scope. If I add the script for signature there, it works but I do not want it to be in global scope. 

I want that if someone clicks on reply All from the email, it should show the signature and other content.

Signature script -

(function runMailScript(current, template, email, email_action, event) {

    // Get the logged-in user's sys_id
    var userID = gs.getUserID();

    // Initialize a GlideRecord object for the sys_user table
    var userGR = new GlideRecord('sys_user');

    // Query the sys_user table for the current user's record
    if (userGR.get(userID)) {
        // Retrieve the user's details
        var userName = userGR.getValue('name');
        var userTitle = userGR.getValue('title');
        var userEmail = userGR.getValue('email');

        // Construct the signature template with HTML formatting
        var signatureTemplate =
            '<br>' +
            '<br>' +
            userName + '<br>' +
            userTitle + '<br>' +
            userEmail;

        // Return the signature to be included in the email
        template.print(signatureTemplate);
    }

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

 

0 REPLIES 0