Closed gbonline closed 10 years ago
@gbonline hey, what version of letter_opener are you using?
Hi,i'm sorry i've forgot this info, i've installedthis gem 1 month ago: letter_opener 1.2.0
----Messaggio originale----
Da: notifications@github.com
Data: 18/04/2014 14.02
A: "ryanb/letter_opener"letter_opener@noreply.github.com
Cc: "gbonline"gbonline@libero.it
Ogg: Re: [letter_opener] Email with image as attachment inline (#90)
@gbonline hey, what version of letter_opener are you using?
— Reply to this email directly or view it on GitHub.
@gbonline well, since you specify encoding by yourself I think you have to decode your image in template by yourself too. Not sure how gmail client viewer works though but letter_opener just renders your email template so it doesn't know about your custom encoding...
Hi, I agree with you. but I followed the rails guide about to embed an image on a mail layout and the solution shown use the attachment inline tenchique:define the attachment.inline['logo'] on the mail controller, and use the <%= image_tag attachment.inline['logo'].url %> in the mail view erb template. All works well with some other mail client rather than gmail, because rails insert the base64 encoded image. On gmail this is not enough, i need to explicitly encode the image and tell wich is the code!Maybe is an issue of the rails3 Actionmailer code. with google i've found someone have resolved that issue by upgrading to rails4!With your gem I can see the correct logo image on the top of my emails only if i use the generic attachment.inline method. with the other the image isn't showed, i see only a placeholder.thanks for answer Giorgio
----Messaggio originale----
Da: notifications@github.com
Data: 18/04/2014 16.37
A: "ryanb/letter_opener"letter_opener@noreply.github.com
Cc: "gbonline"gbonline@libero.it
Ogg: Re: [letter_opener] Email with image as attachment inline (#90)
@gbonline well, since you specify encoding by yourself I think you have to decode your image in template by yourself too. Not sure how gmail client viewer works though but letter_opener just renders your email template so it doesn't know about your custom encoding...
— Reply to this email directly or view it on GitHub.
Thank's for attention! After some modification requests from users of the application, i've spend some time to invetigate this issue. At end i discovered that i didn't need the Base64 conversion, but I need to specify the content and mime_type only, as:
attachments.inline['logo'] = { content: File.read("#{Rails.root}/app/assets/images/logo_header.png"),
mime_type: "image/png" }
Thank's alot for your work. Giorgio
Hi, thank's for this good gem for developers. But I've a problem with the image as attachment inline on rails 3.2.17-ruby 1.9.3. If I write the attachments as follow, the mail delivered are showed correctly by letter_opener on browsers
BUT the mail mail delivered on production to gmail is wrong, so i looked for a solution and I write the new code below for the attachment:
this resolve the gmail client viewer. But this new code is not good for letter_opener: the inline image is not showed.