Only Last attachment to be sent in Email Notification

awentz
Kilo Contributor

Our system is set up with Cases that are being worked and resolved (like an IT Incident). An Email Notification is sent out on case resolution that includes Close Notes the case worker types in. On occasion, there is also an attachment that needs to go back to the requester however, there can be multiple attachments (pdf, excel, etc) linked to the Case and we only want the last attachment that the case worker adds to be sent out with the final Email Notification (Resolution) - not all attachments. This would prevent the case worker from sending an additional manual email with an attachment. What is the best way to build this?

We want:

1.) The last attachment the case worker adds to the case to be sent in the the Email Notification (Resolution)

2.) If the Case worker does not upload an attachment, then the Email Notification is sent without an attachment (even if attachments are in the case as they came in from the email on Case Create).

My other thought would be if there was a way to attach a file within the 'Closed Notes' section and only that attachment would be sent. Not sure if that is even possible.

Let me know if you have any suggestions or ideas.

11 REPLIES 11

Hi Edwin,


Nice post. Quick question though... following the same scenario...


I am assuming that all outgoing emails for the table in place will only send out only the last attachment.


What about adding a condition that this business rule is only triggered when the status of the selected table is (lets say) 'Closed'. Otherwise, I would like all attachments to go out for any other notification... except when status is Closed.



Thanks in advance for your feedback...



Cheers,


Luis


Hello Luis,



Thank you for your comment.



You will need to modify the condition for the after insert business rule to something similar to this:



current.mailbox.getDisplayName() == "Outbox" && current.target_table == 'yourCaseTableNameHere'   && current.state == 7




Thank you


Thanks Edwin! Do you know how you would modify this to send the attachment only if it is NEW or UPDATED?



In other words, when we are replying to a customer, we often attach screenshots with the steps required. We only want to send the attachment if we've just added it to the incident. We don't want to keep re-sending the latest attachment in subsequent notifications if we haven't attached anything else.




Also, if I've attached two or three files in one update to the incident, I want to send those updated files. So I just need something that will send attachments that were just added in the latest update.




Thank you!


Hi Edwin,



I think this is the solution that I want, but I can't get it to work - Can you confirm which table the Business Rules should be running on and walk through exactly what the rules are doing. I think i'm missing the point as to what happens when attachments are added to a record etc.



Thanks for any help you can give.



Maddy


poyntzj
Kilo Sage

Follow this thread. It does have a link to another thread



add attachments to outbound notifications



In essence I have a table that notes when an attachment was sent to a 3rd party.


If the attachment has not been sent, it will go. If it has been sent, it is not sent again



the above link is what I did on the email side.   The link inside that message is linking to what I did for WSDL.



This is on our Calgary release, I have not used later versions so not sure of the behaviour of the "Include attachments" in outgound notifications.



Cheers