You need to sign in to do that
Don't have an account?
Ido Greenbaum 10
custom Email Service - inline images appear as '[Image is no longer available]' upon Reply/ReplyAll
I recently completed a customized Email Service, to replace Email-To-Case, which handles duplicates by matching the incoming email subject with existing cases.
As part of the InboundEmailHandler class, I am handling the binary attachment Images under the following function:
This is working fine, and the Images appear inline when viewing the incoming Email. The problem I'm facing - when using 'Reply' / 'Reply All' of the Email Message feed item in the Case object, the Email Publisher sets the Email Thread, but the inline images are replaces with: [Image is no longer available]
Can anyone suggest a valid solution for this? As a side note - in the traditional Email-To-Case, the email thread includes the inline images properly upon reply. If they only shared the source code of this solution....
Thank you.
As part of the InboundEmailHandler class, I am handling the binary attachment Images under the following function:
private static String getImageReference(List<Messaging.InboundEmail.Header> headers){ for(Messaging.InboundEmail.Header header: headers){ if(header.name.startsWith('Content-ID') || header.name.startsWith('X-Attachment-Id') || (header.value.startsWith('ii') || header.value.startsWith('< image'))){ return header.value.replaceAll('<', '').replaceAll('>', ''); } } return null; }
This is working fine, and the Images appear inline when viewing the incoming Email. The problem I'm facing - when using 'Reply' / 'Reply All' of the Email Message feed item in the Case object, the Email Publisher sets the Email Thread, but the inline images are replaces with: [Image is no longer available]
Can anyone suggest a valid solution for this? As a side note - in the traditional Email-To-Case, the email thread includes the inline images properly upon reply. If they only shared the source code of this solution....
Thank you.
Please find the suggested solution from stack exchange community for a similar issue.
After saving off the attachments then I updated the message body to replace the cid references with URL to the files. For some magical reason, Salesforce will properly format the reply in a way that the inline images appear.
There are two files: 1. EmailUtils 2. Email2CaseHandler
The magic occurs in Email2CaseHandler lines 40-56.
EmailUtils : Email2CaseHandler : Hope this helps.
Please mark this as solved if it's resolved so that it gets removed from the unanswered queue which results in helping others who are encountering a similar issue.
Thanks,
Nagendra