Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The attached patch does the following:
- Adds rudimentary libraries support so that Emogrifier code can be maintained separately from htmlmail module code.
- Somewhat improves the documentation in the README file to mention the Emogrifier support.
- Adds the contents of site CSS files to the internal stylesheet, before the custom htmlmail css.
With this patch, finally my newsletters look the same in email as they do on the web!
Comment | File | Size | Author |
---|---|---|---|
#38 | modules_htmlmail.patch | 39.64 KB | pillarsdotnet |
#38 | htmlmail.zip | 14.92 KB | pillarsdotnet |
#40 | modules_htmlmail.patch | 43.46 KB | pillarsdotnet |
#40 | htmlmail.zip | 16.62 KB | pillarsdotnet |
#39 | modules_htmlmail.patch | 39.74 KB | pillarsdotnet |
Comments
Comment #1
pillarsdotnet CreditAttribution: pillarsdotnet commentedImproved patch, also combined with #1017776: Add transliteration support and #987174: Return-Path support
Comment #2
jason.fisher CreditAttribution: jason.fisher commentedlove it. Will give this a shot on a project next week.
How is ths technique for Outlook/Hotmail/Yahoo/etc?
Comment #3
pillarsdotnet CreditAttribution: pillarsdotnet commentedUpdated patch fixes typo in transliteration support.
@jason.fisher -- Works fine in Hotmail, Yahoo, iPhone (with transliteration), and Andrioid. Also works fine in GMail and Thunderbird. Haven't tested Outlook but I don't expect problems.
Comment #4
pillarsdotnet CreditAttribution: pillarsdotnet commentedRerolled patch after the Great Git Migration.
Combines #1017776: Add transliteration support
Comment #5
lloydpearsoniv CreditAttribution: lloydpearsoniv commentedPHP Fatal error: Call to undefined function libraries_get_path() in /var/aegir/platforms/prod1/drupal-7.0/sites/all/modules/htmlmail/htmlmail.module on line 222
Comment #6
pillarsdotnet CreditAttribution: pillarsdotnet commentedOkay; rewrote so that libraries support is merely recommended, not required.
EDIT: Ignore this patch -- it has a typo.
Comment #7
pillarsdotnet CreditAttribution: pillarsdotnet commentedTrying again...
Comment #8
lloydpearsoniv CreditAttribution: lloydpearsoniv commentedNotice: Undefined variable: path in _htmlmail_emogrify() (line 228 of /var/aegir/platforms/prod1/drupal-7.0/sites/all/modules/htmlmail/htmlmail.module).
i had change the path manually before trying your update to see if i can get it working.
I followed all of the instructions but my emails do not show my theme. I thought maybe it was because i was using a subtheme, so i tried the basetheme & that didnt work either. Is there something else to this process that i am missiing?
Comment #9
pillarsdotnet CreditAttribution: pillarsdotnet commentedYou're probably not missing anything; I just made a typo again. Edit your htmlmail.module and on line 228 change
$path
to$emogrifier_path
.Fixing...
Once you do get it straight, check your admin/reports/status page -- it should tell whether the Emogrifier code was found. Then visit admin/config/system/htmlmail/settings and check the following boxes:
I should probably make it so that the "Use site CSS" also checks "Emogrifier", and so that both options are disabled if Emogrifier is not available.Comment #10
pillarsdotnet CreditAttribution: pillarsdotnet commentedImproved and lightly tested. Patch looks bigger because the _htmlmail_emogrify() function was moved to an include file, but overall code size is actually reduced as compared with the last patch.
Comment #11
pillarsdotnet CreditAttribution: pillarsdotnet commentedBetter status report text.
Comment #12
lloydpearsoniv CreditAttribution: lloydpearsoniv commentedPHP Fatal error: Call to undefined function _htmlmail_emogrifier() in /var/aegir/platforms/prod1/drupal-7.0/sites/all/modules/htmlmail/htmlmail.install on line 60,
Thats after trying the latest patch
Comment #13
pillarsdotnet CreditAttribution: pillarsdotnet commentedweird... Maybe I can't use module_load_include() in an install hook?
(testing...)
Weird. Works for me...
Either drupal_get_path() is not available or you are missing the include file created by the last patch.
Try this one. If it doesn't work, check to make sure that that
emogrifier/emogrifier.inc
exists within thehtmlmail
module directory.Attaching both a patch and a zipped copy of the patched module.
Comment #14
lloydpearsoniv CreditAttribution: lloydpearsoniv commentedi replaced my directory with the one in the zip file...and this is what i got.
Warning: implode(): Invalid arguments passed in htmlmail_requirements() (line 67 of /var/aegir/platforms/prod1/drupal-7.0/sites/all/modules/htmlmail/htmlmail.install).
Comment #15
lloydpearsoniv CreditAttribution: lloydpearsoniv commentedmaybe the issue could be related to the fact that i am running PHP 5.3
Comment #16
pillarsdotnet CreditAttribution: pillarsdotnet commentedI'm running PHP 5.3.6
Try this one.
Comment #17
lloydpearsoniv CreditAttribution: lloydpearsoniv commentedWarning: Missing argument 1 for _htmlmail_emogrifier(), called in /var/aegir/platforms/prod1/drupal-7.0/sites/all/modules/htmlmail/htmlmail.admin.inc on line 28 and defined in _htmlmail_emogrifier() (line 60 of /var/aegir/platforms/prod1/drupal-7.0/sites/all/modules/htmlmail/emogrifier/emogrifier.inc).
Comment #18
pillarsdotnet CreditAttribution: pillarsdotnet commentedbah.
Comment #19
lloydpearsoniv CreditAttribution: lloydpearsoniv commentedright back to this error again.
PHP Fatal error: Call to undefined function _htmlmail_emogrifier() in /var/aegir/platforms/prod1/drupal-7.0/sites/all/modules/htmlmail/htmlmail.admin.inc on line 28
Comment #20
pillarsdotnet CreditAttribution: pillarsdotnet commentedI honestly don't see how that error is possible. The include line immediately precedes the error you are reporting. Is it possible that PHP is running out of memory?
Comment #21
lloydpearsoniv CreditAttribution: lloydpearsoniv commentedI have my PHP memory set to 512M in both apache2 & cli php.ini on a server with 7.5GB of memory. PHP is not running out of memory.
I removed my old htmlmail folder from the server & replaced with the on from the zip file, restarted apache to make sure apc isn't interfering & this is what i got.
I am actually getting 500 errors when using your version of the module & i have to look at the server logs just to find out whats wrong.
Comment #22
pillarsdotnet CreditAttribution: pillarsdotnet commentedThis should avoid the 500 errors but shouldn't work any differently. Somehow the module_load_include() line isn't working for you. Check permissions on the files and directories created by the patch?
Comment #23
lloydpearsoniv CreditAttribution: lloydpearsoniv commentedhere is the new error that i am getting
Warning: array_flip(): Can only flip STRING and INTEGER values! in _htmlmail_emogrifier() (line 69 of /var/aegir/platforms/prod1/drupal-7.0/sites/all/modules/htmlmail/emogrifier/emogrifier.inc).
Comment #24
pillarsdotnet CreditAttribution: pillarsdotnet commentedAgain, I can't imagine where that error is coming from. The only possible value of $paths in the code I submitted is NULL or an empty array.
(hmm...)
Well, in one place I assume that an uninitialized variable is empty(). I suppose that's a bad assumption, but in PHP it's *supposed* to be true.
Nevertheless, removing the assumption:
Comment #25
pillarsdotnet CreditAttribution: pillarsdotnet commentedLooking again, I suppose it was converting NULL to array(0=>NULL) which would explain the problem.
Fixed?
Comment #26
lloydpearsoniv CreditAttribution: lloydpearsoniv commentedI am getting a 500 error on chrome & a whitescreen on firefox when trying to sends a test email. I cant find any visible errors anywhere at the moment.
Comment #27
pillarsdotnet CreditAttribution: pillarsdotnet commentedOkay, I can duplicate that. I'm having no problems sending newsletters, but I'm getting the same error on a test message.
(troubleshooting...)
Errors the same way on simplenews "send test" and htmlmail "send test"... Curiouser and curiouser...
Comment #28
lloydpearsoniv CreditAttribution: lloydpearsoniv commentedThats how i was getting a majority of my errors, via attempting to send a test message. I should have stated that earlier
Comment #29
pillarsdotnet CreditAttribution: pillarsdotnet commentedOkay, fixed, I think. At least, test messages now send on *my* site...
(another stupid typo, btw -- "emogrifer" --> "emogrifier")
Comment #30
lloydpearsoniv CreditAttribution: lloydpearsoniv commentedSUCCESS!!!
Now i have to figure out why my theme isn't going through the email
Comment #31
lloydpearsoniv CreditAttribution: lloydpearsoniv commentedMy emails look like the attachment yet my site looks like this http://pearsoncommunications.com
Any idea on how to fix this?
Comment #32
pillarsdotnet CreditAttribution: pillarsdotnet commentedScreenshots attached:
admin/config/htmlmail/test
screen I'm using.So... compose something with html that would get styled by your theme CSS and test. Of course, it would be nice if the htmlmail test page would allow filter selection and wysiwyg editors like the node editing page, but that's a matter for another patch.
admin/config/system/htmlmail
you have the following (and only the following) checked:admin/reports/status
and make sure that "Emogrifer class" is "Available".Comment #33
pillarsdotnet CreditAttribution: pillarsdotnet commentedComment #34
pillarsdotnet CreditAttribution: pillarsdotnet commentedModified so that it only grabs styles with "media=all" or "media=screen" and ignores the rest.
Comment #35
pillarsdotnet CreditAttribution: pillarsdotnet commentedHeavily modified and lightly tested.
Comment #36
pillarsdotnet CreditAttribution: pillarsdotnet commentedDiscovered that having a blank value for $mail_system[$module] produces a run-time error. Re-coded to prevent that from happening.
Comment #37
pillarsdotnet CreditAttribution: pillarsdotnet commentedMinor improvements:
Comment #38
pillarsdotnet CreditAttribution: pillarsdotnet commentedMore improvements:
Cleanup:
Todo:
variable_set('mail_system')
to its own module.EDIT: This patch relies on drupal_html_to_text which is currently broken by Patch #356074. A fix is posted in the same thread.
Comment #39
pillarsdotnet CreditAttribution: pillarsdotnet commentedFixed bug that was preventing the "Plaintext emails only" profile field from saving.
Comment #40
pillarsdotnet CreditAttribution: pillarsdotnet commentedCreated "Mail System" module for displaying the administrative UI for setting the mail_system variable.
Todo: Add AJAX to the form so a new module can be added without reloading the page.
Comment #41
pillarsdotnet CreditAttribution: pillarsdotnet commentedOkay, split this whole thing off to a sandbox module:
http://drupal.org/sandbox/pillarsdotnet/1088646
Note that the title says "Theme Mail" and the instructions say "theme_mail" but really it's just a fork of HTMLMail.
Comment #42
pillarsdotnet CreditAttribution: pillarsdotnet commentedAh; nevermind. I see I now have commit access.
Committed to 7.x-1.x branch.