The newsletter doesn't give absolute paths to the website. Say I create a newsletter, and insert an image. When I send the HTML newsletter and then check my e-mail everything works but the images. When looking at the e-mail in detail it is using something like "Only local images are allowed." instead of giving the full path to my website. I have tried setting my base path in my settings.php but doesn't seem to help anything. I looked at the module if I could hack it but it just does a node->body so my guess it is need to have a regular expression that runs on the body part to fix it, but I don't know enough about PHP & regex's to fix it myself. Any help would greatly be appreciated.

Comments

xamox’s picture

Sorry I didn't realize in my post about that it would try to render image tags in quotes. But I said [img src="/files/images/image.jpg"] instead of [img src="http://mywebsite.com/files/images/image.jpg"].

markhope’s picture

I agree this is an important issue. I agree preg_replace would be the best way to go. I'm not too good with preg_replace so for now I'm applying the themeing patch:
http://drupal.org/node/83842

and then applying a base url to the outgoing mail.

in template.php do something like:

	function THEMENAME_simplenews_message($node) {
		$output = '<base href="http://example.com/" /><p>header code</p><h2>'.$node->title.'</h2>'."\n".$node->body.'<p>Footer code</p>';
		return $output;
	}

This will display the images.

xamox’s picture

Thanks but I have recently ditched this module and now just use CCK with the mail module. Now I have to figure out how to do it for that. ;)

praseodym’s picture

Version: 4.7.x-1.x-dev » 5.x-1.2

This issue still appears in the latest 5.x version.

sutharsan’s picture

Status: Active » Closed (won't fix)

The conversion of img tag's in html newsletters is not performed by simplenews. You need to check the mimemail issue queue.