Any options for inline attachments MailgunAdopter
In past, we were using mailgun wrapper https://github.com/evercam/mailgun/commit/8c73ada08137ce875b487949167d60fecb1715dc and added inline attachment options by ourselves.
Now we are planning to switch to Bamboo, and I have done formal emails method conversion from mailgun to bamboo mailgun adopter but it's not sending inline attachments, Is there any option for that in bamboo?
For emails like

Instead of showing image as mentioned in template.
<img src="cid:snapshot.jpg" alt='Last Snapshot' style="width: 100%; display:block; margin:0 auto;">
its just showing it alt text. and in the bottom it attached the snapshot. I am sorry if that is not the right place to ask this. I have tried in Elixir Slack channel but no one is interested to answer.
Hi @ijunaid8989 thanks so much for opening the issue and for the patience! I'm just starting to maintain Bamboo and trying to look through the open issues.
This seems related to https://github.com/thoughtbot/bamboo/issues/502. It seems like it might be good to allow people to set the content_disposition and then map that to the adapters as needed.
If this is still something of interest, let me know. I'll try to get to it, or if you're up for it, I'd be happy to review a PR.
Hi @germsvel,
I've just encountered this issue using the bamboo_ses adapter, and I realise that to get inline images, it touches a lot of places in the code base.
Right now, attachments are abstracted by the Bamboo.Attachment struct, which means that you can add a Content-Id header, but you can't add an X-Attachment-Id, or change the Content-Disposition from attachment to inline. Also parts need to be restructured depending on whether inline, non-inline, or both types are being attached. The body of the email should be in the same multipart/related part as any inline attachments, but non-inline attachments live in the outer multipart/mixed part, though it's a little more nuanced than that:
https://stackoverflow.com/questions/30351465/html-email-with-inline-attachments-and-non-inline-attachments
As a lot of things need to change depending on whether the attachment needs to be inline or not, so I'd recommend adding a boolean to the Attachment struct. According to this boolean being set to true, the following things would need to occur:
- a
Content-Idheader must be supplied - a
X-Attachment-Idheader is added that matchesContent-Ids raw value - the
Content-Idis surrounded by <angle brackets> - set
Content-Dispositiontoinline - wrap
multipart/alternativecontaining html/text email body with amultipart/related - insert inline attachment into
multipart/relatedwrapper
This is as much as I can surmise in my 2 hours of research, and particularly point no. 3 might be archaic, so you might know better, or there might be new guidelines for approaching this. I'd be curious to know your thoughts, and if you're all tied up, I might be able to jump in and make a PR. Either way, I need to get this to work for myself, so let me know.
Cheers,
Jarrod