Images on AWS missing from body of emails on iOS Mail app

I don’t know where that code is, but we’re looking at the topic’s preview image (t.image_url) and rendering it using url_for_email(t.image_url) like so:

https://github.com/discourse/discourse/blob/master/app/helpers/user_notifications_helper.rb#L105-L109

Maybe iPhone Mail doesn’t like <img src="//somewhere.com/image.png">? Also I don’t see where that “baseballcap” text could be coming from…

4 Likes

I think that’s the issue too

I’m guessing the URL to the image you use is held in t.image_url ?

I know the language I use here is wrong, but you’ll understand my logic :slight_smile:

Could someone add a simple:

IF LEFT(t.image_url, 6) =! 'https:' THEN t.image_url = 'https:' & t.image_url 

:thinking:

And re:

That’ll be coming from here:

Please let me know if I can provide any more details? :+1:t2:

Why not simply change all your CDN urls to be https:// vs // and then rebake everything.

I don’t have any CDNs, @sam? :thinking:

I recommend adding one then, it will save you money anyway

That seems a bit excessive when simply adding 6 characters to the URL (https:) could fix this issue for everyone :confused:

You can set the CDN url to your s3 base url and add the https there, it should work

3 Likes