Since imagecache images are only generated when they are accessed via http, it can happen that imagecache images are referred to in a mimemail message, but the image in question has not yet been generated.
In this situation, mimemail will not only fail to embed the image, but tacks on http:// to the beginning of the relative URL, making it completely unusable.
The following patch adds support for not-yet-rendered imagecache images. If imagecache images are encountered in a message, it will check to see if they have been properly rendered to file, and if not will instruct imagecache to render them before continuing with the embed.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | mimemail_1309248_03_d6.patch | 1.82 KB | sgabe |
| #1 | mimemail_1309248_02.patch | 1.61 KB | sgabe |
| mimemail_imagecache.patch | 1.83 KB | gmania |
Comments
Comment #1
sgabe commentedI am attaching a revised patch of yours.
Comment #2
sgabe commentedSeems to work for me. Committed to D6, needs to be ported to D7.
Comment #3
sgabe commented#2227605: image styles not generated at first request is a duplicate of this.
Comment #4
adamps commentedUpdated title to closer match D7 terminology (D6 is all fixed now).
For D7, one possible workaround is using the image_resize_filter module. It has code to generate the image styles. Set the variable mimemail_format - in GUI admin/config/system/mimemail/ "E-mail format" to a text format that includes "Image resize filter".
This module also contains some helpful code towards fixing this issue. Search for the call to image_style_create_derivative around line 353.
Comment #5
Ives commentedFor a quick fix, I used following code in my template:
See http://drupal.stackexchange.com/questions/54581/force-image-style-genera...
Comment #6
chrbak commentedThis problem continues to the version for drupal 8 too.