email client template attchment needs to add in the attchment field

Praju_123
Tera Contributor

I have created email client template for the negotiation table whenever I applied the template that time email content and email attachment is populated on the email template in the link format. instead of showing that attachment in the link format can we add that attachment in attachment field on the email template.

Praju_123_0-1747206859143.png

can we add the attachment in this attachment field instead of showing this attachment as an url on the email template.

Praju_123_1-1747207046889.png

 

7 REPLIES 7

Ankur Bawiskar
Tera Patron
Tera Patron

@Praju_123 

check this and enhance as per your requirement

basically you want to include the attachment in the email and not the link

Copy attachments to Email Client Template (...) 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi @Ankur Bawiskar 
this script will capture the attachment from the record and that attachment get captured on the email attachment but in my case I want to capture the attachment from the email template attachment not from the negotiation form record.

Praju_123_0-1747208633206.png

this above attachment i have to copy which i added in the email client template

 

@Praju_123 

then enhance that business rule to pick the file from email client template record rather than the target record

something like this, but please enhance

(function executeRule(current, previous /*null when async*/) {

	// Add your code here
	var lookforatt=new GlideRecord('sys_attachment');
	lookforatt.addQuery('table_sys_id', 'sysId of email client template'); // give the sysId here
	lookforatt.query();
	if(lookforatt.next())
		{
GlideSysAttachment.copy('incident', current.instance, 'sys_email', current.sys_id);
}
})(current, previous);

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi @Ankur Bawiskar 
Still, it copies the record attachments only not copying the email template attachment.