5

When our site migrated to Pantheon, all the images in a mailing became broken when the mailing was received.

I saw this (https://stackoverflow.com/questions/27569280/civicrm-civimail-images-are-relative-urls) but the question is only partially answered.

I can't see any settings in the menu for the editor. How do I make the WYSIWYG editor for mailings provide absolute URL refs? Otherwise the images look fine in the preview but are all broken when the mailing is sent.

To clarify, the refs are coming out as "/sites/default/files/civicrm/image.jpg" instead of "http://mysite.com/sites/default/files/civicrm/image.jpg" and that is why they are broken.

Any help would be appreciated. Thanks!

3

When CiviCRM is on Pantheon, it needs a special set of config in the civicrm.settings.php which defines various variables to make CiviCRM work in cloud hosting.

I had to add this variable to that list:

$civicrm_setting['URL Preferences']['imageUploadURL'] = 'http://www.mysite.com/sites/default/files/civicrm/persist/contribute/';

Then I had to make sure that the "system settings"->"Directories" was pointing to the same folder. Then it worked!

  • I'm having this same problem. I have this line in civicrm.settings.php : $civicrm_setting['URL Preferences']['imageUploadURL'] = $base_url . '/sites/default/files/'; The Url is still coming out as /sites/default... Any clues? – Yossi Mar 2 '16 at 3:29
2

Have you tried to override the CKEditor config file? You could set baseHref to http://mysite.com (config reference). I think this will do what you need.

  • Thanks for this. It didn't end up being the solution but it put me on the right track to find the solution! – TheBarnacle Aug 18 '15 at 9:49
0

Please make sure all the images are accessible over the web on its own and then send the email

  • Thanks for this answer. Perhaps I should clarify that the refs are coming out as "/sites/default/files/civicrm/image.jpg" instead of "mysite.com/sites/default/files/civicrm/image.jpg" so although they are accessible over the web, the refs are not specific enough because they are not absolute. – TheBarnacle Aug 11 '15 at 13:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.