Need help in email client templates

Deepthi13
Tera Expert

Hi team,

I have created an email client template and calling a script include inside it to update "from" address in it. but it is not working as expected also not creating any logs from script include. please suggest.

Deepthi13_0-1719149306981.png

Deepthi13_1-1719149459874.png

 

5 REPLIES 5

Arpan Baishya
Kilo Sage

Hi @Deepthi13,

 

I think it would be a good idea to change the From Generation Type value to Script and then check if your script works.


To give you an idea of how a sample script for this field could look like, let me share this link with you.

 

Let me know if this helps.

tried script in generation type, but it is also not wokring

(function (fromAddressQuery, targetRecord) {
        /**
         * fromAddressQuery: A GlideRecord on the table "sys_email_client_from_address". Add conditions to filter the
         *      the email addresses displayed in the Email Client.
         * targetRecord: A GlideRecord representing the record in which the Email Client was opened from
         */


    // targetRecord is incident for this template
    var AssignmentGroup = targetRecord.assignment_group;

    if (AssignmentGroup == '4d3dcd67db0a3810b9316b4bd3961980'){
        gs.log("script testingg")
        fromAddressQuery.addQuery('email_address', targetRecord.u_guest_user_email);
    }
})(fromAddressQuery, targetRecord);

Deepthi13_0-1719336192482.png

 

also, i tried directly hardcoding giving like "select from list" by creating record in "sys_email_client_from_address" table and selected it still it is not working

Deepthi13_2-1719336411530.png

 

 

Community Alums
Not applicable

Hi Deepthi,

It seems you are calling the script include from client side, Please make the necessary changes as below-

Client callable should be checked true.

 

SanjayG_0-1719158066882.png

 

You need to modify the script like below-

var Emailutils_V3 = Class.create();
Emailutils_V3.prototype = Object.extendsObject(AbstractAjaxProcessor, {

	setFromReplyToAria: function() {

		//Your code here
		
	},

    type: 'Emailutils_V3'
});

 

Adjust as above and ensure to include this- Emailutils_V3.prototype = Object.extendsObject(AbstractAjaxProcessor

 

If my response has resolved your query, please consider giving it a thumbs up ‌‌ and marking it as the correct answer‌‌!

 

Thanks & Regards,

Sanjay Kumar