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
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

gargsuchi’s picture

Issue summary: View changes
sgabe’s picture

Status: Active » Needs review
sgabe’s picture

Title: Images in email were not showing up - patch attached » Images with 'itok' token not showing up
Status: Needs review » Fixed

Committed, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

sgabe’s picture

kbrownell’s picture

Hello. 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.