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.
Hey,
Before I enable this module (fresh install of Drupal 6.20, nothing but the default modules on), I get this as a registration email.
rickman,
Thank you for registering at devel6. You may now log in to http://devel6/user using the following username and password:
username: rickman
password: eGcGn4M3Ro
You may also log in by clicking on this link or copying and pasting it in your browser:
http://devel6/user/reset/21/1303514266/bf7f459e41aeb19bd3e84d6163cb7f86
This is a one-time login, so it can be used only once.
After logging in, you will be redirected to http://devel6/user/21/edit so you can change your password.
-- devel6 team
But if I simply turn on the module, the regular line breaks are now ignored and it makes this garbled mess.
rickman, Thank you for registering at devel6. You may now log in to
http://devel6/user using the following username and password: username:
rickman password: M5x96J7yMJ You may also log in by clicking on this link or
copying and pasting it in your browser:
http://devel6/user/reset/22/1303514346/1a42857f64f2982b9f5c0b02a701db70 This
is a one-time login, so it can be used only once. After logging in, you will
be redirected to http://devel6/user/22/edit so you can change your password.
-- devel6 team
I've tried playing with the short list of settings at admin/settings/mailsystem, but I only can choose between default and testing. Testing clearly just hides the email so that's not a solution.
I'm not turning on HTML email at this point. But even turning that on doesn't help.
I'm marking this as 'major' as it's a deal breaker for now.
Comments
Comment #1
rickmanelius CreditAttribution: rickmanelius commentedThis seems to be the culprit.
If I comment out $message['body'] = drupal_html_to_text($message['body']); I can at least get the proper line breaks. I realize this isn't ideal, so I'm not going to do it. But it that drupal_html_to_text function is removing the line breaks in the default user registration message. So simply turning on this module (without html email) will remove the line breaks.
Comment #2
rickmanelius CreditAttribution: rickmanelius commentedNext followup.
If your turn on the HTML mail module, it will work if you turn on the full html input format for anonymous users. If you don't have that enabled, it will go back to a single line.
I actually don't like this setup... because it prevents sending a rich text email to a user without giving them rich text input format capabilities on the front end (comments, etc). So is it possible to remove that restriction and allow the outgoing emails to format with Full HTML even if that user type does not have that capability?
Comment #3
pillarsdotnet CreditAttribution: pillarsdotnet commentedTesting to confirm what you describe... Yup. The
drupal_html_to_text()
function is broken, as described here:#299138: Improve \Drupal\Core\Utility\Mail::htmlToText()
I suppose I should supply a copy of the patched version with d6 Mail System. (patching...) Okay; fixed in 6.x-2.3 release.
By the way, you will have exactly the same problem if and when you upgrade to Drupal-7, unless #299138 gets resolved first.
Rolled a new release of HTML Mail to use
mailsystem_html_to_text()
instead ofdrupal_html_to_text()
, at least until issue #299138 gets resolved.@#2 -- I'm not sure what you want here. It sounds like you want the end-user to type in plain text and the mail system to somehow convert that to HTML. If you just want to preserve line breaks, add the standard Line break converter to your input filter. For more sophisticated text-to-html conversion, try using Markdown or BBcode.
Comment #4
pillarsdotnet CreditAttribution: pillarsdotnet commentedAlso see http://drupal.org/node/299138#comment-4383404
Comment #5
Heine CreditAttribution: Heine commented#299138: Improve \Drupal\Core\Utility\Mail::htmlToText() is about D7's (and D8's) drupal_html_to_text.
D6 behaviour is by design; whitespace in HTML must be collapsed. See #298708-12: drupal_html_to_text() removes line endings.
Comment #6
pillarsdotnet CreditAttribution: pillarsdotnet commented@Heine -- Are you saying that the
DefaultMailSystem::format()
method is broken because it blindly appliesdrupal_html_to_text()
to all input?If so, have you submitted a bug report?
Or perhaps you are claiming that the d6 and d7 versions of
drupal_html_to_text()
are somehow completely different despite sharing identical doxygen headers?If so, have you submitted a bug report?
Comment #7
Heine CreditAttribution: Heine commentedI'm saying that D6 behaviour is by design.
Comment #8
pillarsdotnet CreditAttribution: pillarsdotnet commentedThen I am saying that the design is faulty and should be corrected. See http://drupal.org/node/299138#comment-4384420
Comment #9
rickmanelius CreditAttribution: rickmanelius commented@#3
I'm really talking about system emails. Right now, when the system send out an email (e.g. user registration confirmation w/new username and password), it will be a collapsed single line of text UNLESS anonymous users are allowed to access the full html input filter. So if the system is preparing the message, it should not be restricted by a user's access to format filters!
Also, the reason why I agree with you in saying this design is faulty: if someone is to switch on the HTML mail module right now, they are in for a serious surprise as it's going to be this compressed plain text. It took me 3 hours of navigating in and out of the modules and GUI options to figure it out. There will probably be a lot of forum questions until (out of the box) the HTML toggle is on and working!
I'm not saying you're not doing an amazing job here. But I was a might surprised when I went through my last drush upgrade! Now, I have simply disabled HTML mail altogether so that the emails are at least working...
Comment #10
pillarsdotnet CreditAttribution: pillarsdotnet commentedAs I said, this is fixed in latest version of both Mail System and HTML Mail. See the diff.
Comment #11
rickmanelius CreditAttribution: rickmanelius commentedHey Pillars.
Apologies. I didn't keep up with the entire thread. I'll be sure to check it out. Thanks for the very speedy response :)