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

Strange behaviour with the Newsletter Module


Go to End


3 Posts   1133 Views

Avatar
codepattern

Community Member, 11 Posts

10 August 2015 at 9:43pm

Hi All. I am experiencing a strange behaviour with the Newsletter Module. When I use $AbsoluteBaseURL in the body of the Newsletter, it converts it to /var/www/vhosts/domain.com/ rather than http://www.domain.com. However, when I send a test email, it renders it correctly i.e. http://www.domain.com . Similar behaviour is experienced when links are converted to Tracked Back links.

Am I missing something or am I just tired?

Avatar
Pyromanik

Community Member, 419 Posts

12 August 2015 at 12:13am

Are you generating the email from a cronjob or otherwise the CLI?
This is most likely the case - so you need to set file to URL mapping, eg. in _ss_environment.php (should be able to go in mysite/_config.php too I guess):

global $_FILE_TO_URL_MAPPING;
$_FILE_TO_URL_MAPPING['/var/www/vhosts/domain.com'] = 'http://domain.com';

Avatar
codepattern

Community Member, 11 Posts

14 August 2015 at 1:51pm

Hmm, I did see this reference somewhere in documentation, but did not believe that the newsletter module used CLI. Let me try it and provide the results back.