Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Newsletter absolute image urls for preview and embed images


Go to End


2 Posts   2800 Views

Avatar
Martijn

Community Member, 271 Posts

4 September 2009 at 10:38pm

Edited: 04/09/2009 10:46pm

I want to use the newsletter module, but I have some (small) problems/questions:

When I preview a newsletter images from the content are not show due to the relative urls.

I tried to set the relative_urls to false in sapphire/forms/HhtmlEditor and in sapphire/javascript/HtmlEditor.js but the images urls are still inserted relative.

I also want that the images are embeded in the email, so recipients don't need to confirm downloading images when they open the newsletter, so the should be sent as attachment with cid pointers etc..
I tried to set $_INLINED_IMAGES to true in Mailer.php function wrapImagesInline() (latest trunk file), but it has no effect.

1. How to show images in newsletter preview.
Edit:: It seems that since the SS install is in a subfolder, the images wont show up.

I added this to NewsLetterAdmin.php function preview() around line 175:

$obj->Body = str_replace('src="assets','src="'.Director::baseURL().'assets',$obj->Body);

which will add the subfolder to the images..

2. How to make embedded/inline images work?

Any directions would be highly appreciated :)

Avatar
Nobrainer Web

Community Member, 138 Posts

30 January 2010 at 10:55pm

Thank you fir the above Martijn, that was helpful.