Attachment Not Included in Email Notification

gnunez
Kilo Guru

Hello all,

I want to include an attachment in our "request completed" email notification. I have uploaded the attachment to the email notification and selected the "Include Attachments" checkbox, but it isn't being uploaded. I thought it was suppose to simple and "include attachments" would attach it but thats not the case. Am I misunderstanding how this checkbox works or does anyone know another way to accomplish this?

Thanks,

Grace

1 ACCEPTED SOLUTION

Sam198
Mega Guru

Hi gnunez,

You can pick up and attach the notification physical attachment to the actual email with a Business Rule on sys_email table:

Before - Insert

Condition:

Subject Starts with = Your subject (or as per your requirement when this BR should run and attach the attachment),

 

var attachment = new GlideRecord('sysevent_email_action');

if(current.subject == "your email subject"){
attachment.addQuery('name', 'Your notification name');


}

attachment.query();

while (attachment.next()) {

strTemp = attachment.sys_id.toString();
GlideSysAttachment.copy('sysevent_email_action', strTemp, 'sys_email', current.sys_id);

View solution in original post

11 REPLIES 11

Hello,

Thanks for the reply. I added the attachment to the email notification thinking it would be added to the email. How can I get this attachment added to the record when closed and completed?

 

Thanks,

Grace

Ashvini Kadus1
Kilo Guru

Hi,

 

The only way you can do this is by attaching the document with the specific record and then selecting option "Include attachments" with notification.

 

Kindly mark correct or helpful if it helps you to solve your problem.

 

Thank You,

Ashvini k

 

Hello,

Thanks for the reply. I added the attachment to the email notification and selected "include attachments", but it wasn't attached. How can I get this attachment added to the record when closed and completed?

 

Thanks,

Grace

Sam198
Mega Guru

Hi gnunez,

You can pick up and attach the notification physical attachment to the actual email with a Business Rule on sys_email table:

Before - Insert

Condition:

Subject Starts with = Your subject (or as per your requirement when this BR should run and attach the attachment),

 

var attachment = new GlideRecord('sysevent_email_action');

if(current.subject == "your email subject"){
attachment.addQuery('name', 'Your notification name');


}

attachment.query();

while (attachment.next()) {

strTemp = attachment.sys_id.toString();
GlideSysAttachment.copy('sysevent_email_action', strTemp, 'sys_email', current.sys_id);


Thank you so much Sam! This is exactly what I was looking for and it worked perfectly!

 

-Grace 🙂