Broken Image in newsletter

How can i fix broken image in newsletter?

Hi @d0v1k

What kind of service do you use to send your newsletter ?

I’m using Amazon SES and I encounter the same problem.

Regards

I’m using the smtp server on the Linux box.

I can’t see to get any help or solution on how to fix it.

Let me know if you find a way to fix it.

Hi @d0v1k,

I’m working so hard ATM, I cannot spend some times working on that issue.

Do you found any solutions ?

I’ll try to work on it ASAP and i’ll let you know if I fix it.

Regards

Hey @d0v1k and the community :slight_smile:

Worked on that thread and I noticed this is duplicate (already asked here)

For Broken Image:
Change in below file:
app/views/community_mailer/_community_update_listing.html.haml
You need to change line number 10 and 24 accordingly:
= link_to((image_tag “https://#{@url_params[:host]}#{listing.author.image.url(:thumb)}”, :width => 50, :height => 50, :style => “display:block;margin-right:20px;margin-bottom:10px;margin-top:0;border:0”), person_url(listing.author, @url_params))
= link_to(image_tag(“https://#{@url_params[:host]}#{listing.listing_images.first.image.url(:email)}”, :class => “listing_main_image”, :alt => listing.title, :height => “100”, :width => “150”, :style => “display:block;margin-left:30px;margin-bottom:20px;margin-top:4px;border:0”, :align => “right”), listing_url(@url_params.merge({:id => listing.id})))

I tested the solution and it worked.

Actually, your images are broken in newsletter (and other mails who contains images btw) because your domain in the src of img tags is not specified. In gmail you get something like : “googleusercontent.com…#http:///system/images/1551019/email/C4C2E647-7775-49E3-9575-64066AF81220.jpeg?1535109810_” (you can notice the domain is missing)

Hope it helps :slight_smile:

Regards

Thank you.
I will test and let you know.
Can you share the file with me?

As above-mentioned: _app/views/community_mailer/community_update_listing.html.haml

Hi,

Can I see your fixed file? Replacing listing.author.image.url(:thumb) with “https://#{@url_params[:host]}#{listing.author.image.url(:thumb)}” (for example) results in a syntax error?

Thanks,

Allister

Hi guys, sorry for the late response.

@Allister you must replace this line (line 10) :

= link_to((image_tag listing.author.image.url(:thumb), :width => 50, :height => 50, :style => “display:block;margin-right:20px;margin-bottom:10px;margin-top:0;border:0”), person_url(listing.author, @url_params))

BY:

= link_to((image_tag “https://#{@url_params[:host]}#{listing.author.image.url(:thumb)}” , :width => 50, :height => 50, :style => “display:block;margin-right:20px;margin-bottom:10px;margin-top:0;border:0”), person_url(listing.author, @url_params))

AND this line (line 24) :

= link_to(image_tag(listing.listing_images.first.image.url(:email), :class => “listing_main_image”, :alt => listing.title, :height => “100”, :width => “150”, :style => “display:block;margin-left:30px;margin-bottom:20px;margin-top:4px;border:0”, :align => “right”), listing_url(@url_params.merge({:id => listing.id})))

BY:
= link_to(image_tag( “https://#{@url_params[:host]}#{listing.listing_images.first.image.url(:email)} ”, :class => “listing_main_image”, :alt => listing.title, :height => “100”, :width => “150”, :style => “display:block;margin-left:30px;margin-bottom:20px;margin-top:4px;border:0”, :align => “right”), listing_url(@url_params.merge({:id => listing.id})))

Hope it helps

Thanks Brice for this; much appreciated.

As you can see the required is exactly what I copied/pasted, but then I got an error! Turned out it was the editor inserting some invisible characters! When I re-typed it everything was good! What a way to waste half-a-day. Editors today are too clever for their own good - back to ‘vi’

Ahaha sad story :smile:

But im glad to hear that your issue is gone !

Have a nice day :slight_smile: