Hi, thanks so much for your work on sparkpost_rails!
I'm trying to include inline images like this:
message[:attachments].each do |ad|
attachments.inline[ad.original_filename] = {
mime_type: ad.content_type,
content: File.read(ad.tempfile),
cid: 'some-name'
}
end
However, the message arrives with a randomly generated Content-Id rather than the specified cid: parameter, and a missing image icon appears where the <img> tag is in HTML, with the attachment at the bottom of the message.
In this case, the email is received from Sparkpost webhook, so the content-id is already set in the incoming email. I parse it out, and then use that value in the cid: parameter in attachments.inline[] = {}. If it were actually used, the image would display inline where specified by the <img> tag, but the cid parameter seems to be ignored.
Hi, thanks so much for your work on sparkpost_rails!
I'm trying to include inline images like this:
However, the message arrives with a randomly generated Content-Id rather than the specified
cid:parameter, and a missing image icon appears where the<img>tag is in HTML, with the attachment at the bottom of the message.In this case, the email is received from Sparkpost webhook, so the content-id is already set in the incoming email. I parse it out, and then use that value in the cid: parameter in attachments.inline[] = {}. If it were actually used, the image would display inline where specified by the
<img>tag, but the cid parameter seems to be ignored.