Okay, so is it weird for me to post a bug related to a patch that I created?
Well I thought I'd post it so that people knew about a bug with the html email functioning in massmailer while we try and track down the problem.
The problem: Image tags in html email messages should use absolute urls. But for some reason the absolute part of the urls are getting stripped out by PHPList. So <img src="http://www.example.com/images/photo.gif"> becomes <img src="/photo.gif">. And the images don't show up in the messages. Very odd.
The workaround: Use single quotes instead of double quotes. Don't know why, but it works.
Presumably when we know why this is happening, we'll fix it. In the meantime, use single quotes.
-Jeff
Comments
Comment #1
Mack Oberman commentedI would love to see this fixed.
Certain ISPs--speakeasy.net in particular--do not take kindly to the use of single-quotes. Their webmail system replaces all such
tags with
. Thus, a certain segment of my subscribers complain that the images are broken each time I send emails, because the single-quote workaround actually causes them problems.
Comment #2
bbaldo commentedI'm getting stuck with this issue, img absolute urls are being stripped anyway...
i have a 4.5.0 drupal installation with massmailer and phplist 2.9.3, anyone found a solution to this problem?
Comment #3
bbaldo commentedI found this solution: http://www.phplist.com/forums/viewtopic.php?t=1072&postdays=0&postorder=...
Basically: open file "class.html.mime.mail.inc" in /admin directory, then remove from the image_types array the image types who's url are being stripped. I commented three lines, see below:
Comment #4
Veggieryan commentedany gotten this working? even with quoting out all the tags in this array, my images are still blocked... civicspace 0.8.5
Comment #5
jeffmikels commentedSOLUTION:
The problem comes in that phplist attempts to "embed" images as mime attachments to emails and then to change the href to refer to the embedded file. However, this doesn't work as expected when running through drupal because, I assume, it can't find the original file in the expected phplist image directory.
The other problem is that there are two files which do the stripping.
ASIDE: These two files appear to do the same thing, so I don't know why they are both there.
Here's the solution, and if I knew how to do a patch I would.
STEP ONE: edit the config file
add the following lines somewhere in /modules/massmailer/engines/phplist/config.php
STEP TWO: edit the class files
In each of the class files (mentioned above) there is a function called
find_html_images. Modify that function like so (without the php tags of course):email me if you have questions.