I seem to be missing something here. I've followed the configuration for emogrifier however I can't seem to get it functioning at all with simplenews and when sending a test from htmlmail, it does fire the emogrifier script (i simply put in a debug_backtrace() in the emogrifier.php script and got a return krumo) but the inline styles do not show up in the email.
I'm using a custom theme for htmlmail with one style sheet and a custom text format identical to the one suggested (pathologic, emogrifier, tranliteration, etc)
Is there anything to suggest in order to debug this? For example, is there somewhere I can make sure the css stylesheets from my theme are being sent to emogrifier.
Also not sure if this is an issue, but i am using localhost to send the mails.
thanks again!
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | emogrifier.zip | 8.69 KB | pillarsdotnet |
| #7 | emogrifier.tgz | 6.05 KB | pillarsdotnet |
| #5 | emogrifier.zip | 8.7 KB | pillarsdotnet |
| #5 | emogrifier.tgz | 6.05 KB | pillarsdotnet |
Comments
Comment #1
blasthaus commentedI found out the reason I was having problems was related to the path not being correct in the url_to_realpath() function in url_to_path.inc
realpath(DRUPAL_ROOT . base_path() . $path); for me instead returns the sitename twice
'Users/username/Sites/sitename/sitename/sites/all/themes/mytheme/css/mytheme.css'
DRUPAL_ROOT : /Users/username/Sites/sitename
basepath() : /sitename/
$path : sites/all/themes/mytheme/css/mytheme.css
Is there something that could work in this case where Drupal has defined my DRUPAL_ROOT and basepath() and both contain the same folder? I just did a basic drush drupal install of this site, no symlinks or anything, so I suspect other people may encounter this
thx
-wil
ps changing title
Comment #2
blasthaus commentedI'm not a php expert but this is how I solved this, let me know if its at least possible to do some error checking on this function. Here's a start.
Comment #3
pillarsdotnet commentedComment #4
pillarsdotnet commentedDRUPAL_ROOTshould point to whatever was the current working directory whenindex.phpwas loaded.base_path()just returns $GLOBALS['base_path'], which is set bydrupal_settings_initialize()by looking at$base_urlor$_SERVER['SCRIPT_NAME']I originally used
realpath('.' . $path)but switched torealpath(DRUPAL_ROOT . base_path() . $path)in response to Damien Tournoud in #1113588-25: Provide find_conf_path() function by re-factoring reusable code from existing conf_path() function..Cross-linking with that issue.
Looks like I should have used
realpath('.' . base_path() . $path).Comment #5
pillarsdotnet commentedCould you try the attached version and see if it works for you?
Comment #6
blasthaus commentedthanks for taking a look. above doesn't work on my localhost but does on live site
below works on both:
i never had any problem with the module not working on a live site.
just to be clear, drupal is set up like this on my localhost http://localhost/drupal
on live site
sidenote: nothing was done out of the norm for this drupal install on my localhost
RewriteBase not on in .htaccess and no base_url declaration in settings.php
Comment #7
pillarsdotnet commentedThanks very much for your help on this issue.
Looks like I can't use
DRUPAL_ROOTin conjunction withbase_path().Could you please try the attached version and let me know if it works for you? I really appreciate your assistance in testing.
Comment #8
blasthaus commentedI can confirm it works on both my localhost and a live site. Thanks a lot. It was also a helpful exercise for me. I didn't test it on a multi-site set up which would be also important to check that DRUPAL_ROOT returns something like /home/username/drupal/sites/yoursitename and not just /home/username/drupal
Comment #9
pillarsdotnet commentedThanks so much for your help. Fix released as 7.x-1.14.