Jump to:

10931 Posts in 2614 Topics by 1810 members

All other Modules

SilverStripe Forums » All other Modules » Newsletter absolute image urls for preview and embed images

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 2148 Views
  • Martijn
    Avatar
    Community Member
    271 Posts

    Newsletter absolute image urls for preview and embed images Link to this post

    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

  • Nobrainer Web
    Avatar
    Community Member
    134 Posts

    Re: Newsletter absolute image urls for preview and embed images Link to this post

    Thank you fir the above Martijn, that was helpful.

    2148 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.