I was facing some issues with images in mails being sent out using mimemail.
I had set the variable mimemail_linkonly as 1, but still the images were not coming up in the email as the source was showing up as relative URL and nt absolute URL. On further investigation, I found that since the images were styles (with applied image styles), the URL for the images were something like this :
http://example.com/sites/default/files/styles/
/public/PF-Test05.jpg?itok=7eVLFUvV
But the preg match in the inc file was looking for URLs ending with jpg/ png/ gif etc.
Hence a change in the inc file from
elseif (variable_get('mimemail_linkonly', 0) && preg_match('!\.(png|gif|jpg|jpeg)$!i', $url)) {
to
elseif (variable_get('mimemail_linkonly', 0) && preg_match('!\.(png|gif|jpg|jpeg)!i', $url)) {
and this worked fine.
Please find attached a patch for the same
Comments
Comment #1
gargsuchi commentedComment #2
sgabe commentedComment #3
sgabe commentedCommitted, thanks!
Comment #5
sgabe commented#2145659: Images with 'itok' token are not embedded is a duplicate of this.
Comment #6
kbrownell commentedHello. We ran into a similar problem with Mimemail 7.x-1.0-beta3 and Simplenews 7.x-1.1. In our case, the URL's were absolute in the final email, but ?itok= was being converted to %3Fitok%3D and therefore the images were not rendering. First parsing the URL solved our problem, patch attached.