How to attach an attachment in Email Notifications

symonflores_23
Tera Guru

[Context] From the catalog item, the user will attach an image to the attachment variable. The image will then be attached to the email notification, rather than being embedded in the email body.

 

[Q] How do we attach the image file to the email? Can I achieve this without using a Business Rule?

 

symonflores_23_0-1715656283889.png

 

1 ACCEPTED SOLUTION

Yes, it does.

In that case you'll have to copy the image from the attachment variable to the actual item record, you can achieve this using the same flow that's triggered when a catalog item is submitted, you can add a copy attachment action just before firing the event to trigger the notification.

Regards,

Hope this helps!
BR.
Ishaan Shoor

View solution in original post

13 REPLIES 13

In this case, what you can do is add an "wait for" condition.
As you mentioned "we want to send the email based on the date & time the user provided in the catalog", so you can set the wait for condition to the date & time mentioned by the user.

 

Once the time has come, look up the email record which was triggered and then use the copy attachment functionality i showed above to attach the attachment to the email record. Rest assured using this method will attach the attachment outside the email body itself.

 

 

If my answer had helped you in any way please mark it as correct or helpful.

Are you saying that we should scrapped the use of eventQueueScheduled and just use wait for condition, and follow the steps you gave?

 

I'm afraid we can't do that since we have standard templates and complex mail scripts to follow.

 

One example that we had in a mail script is that:
If a variable is empty, then it should not appear in the email body.

Ishaan Shoor
Mega Sage
Mega Sage

@symonflores_23 Can you confirm the source record for the event triggered email is the same record that contains the attachment?

a) If yes, the below steps should work for you to add the attachment into the notification.

- Open the notification (from sys_email table) which has been triggered from the event.

- Click on "Advance View" in the notification under related link.

- Go to "What it will contain" tab. Enable "Include Attachment" and save.

- Now, next time when a notification is triggered, it will have an attachment. You can verify this by open the triggered sys_email record and check the attachment tab.

IshaanShoor_0-1715663359513.png


How to send attachment in the notification from Service Catalog? - Support and Troubleshooting (serv...
Document attachments on an email notification (servicenow.com)

b) If not, you'll have to make sure the attachments are present on the source record or have the source record same as the one that as the attachments so that they can be picked up by the email include attachment functionality. 

Hope this helps!
BR.
Ishaan Shoor

Hi Ishaan,

 

Thank you for replying. This still doesn't solved my issue. The image attachment is not attached to the email being sent.

 

This is the image variable from my catalog:

symonflores_23_0-1715664641930.pngsymonflores_23_1-1715664660088.png

Upon checking the "include attachment", it's still not attached to the email.

symonflores_23_2-1715664778185.png

Proof that I attached the test image file:

symonflores_23_3-1715664883131.pngsymonflores_23_4-1715664926992.png

 

Did I missed anything? Or am I doing something wrong?

Is this image on the attachment variable present on the actual record? Or is it just part of the variable? 

Hope this helps!
BR.
Ishaan Shoor