I am using Drupals built-in mail function.
When sending nodes in plain text, the function call to simplenews_html_to_text() causes line breaks to be removed. This means text is clustered and paragraphs are merged.
By commenting out the function call at line 1574 in simplenews.module (http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/simplenews/...) the plain text messages were sent and received as intended.
Comments
Comment #1
sutharsan commentedplease be more specific. Provide samples of text before and after replacement.
I suspect this is about replacement of
<br />tags. This is performed by drupal_html_to_text().Comment #2
Danial Namousi commentedI can't reproduce this behavior at the moment but I'll try to explain the scenario and hope that helps.
If a message was entered as plain text without any HTML and using simple
\n-linebreaks, those linebreaks would be removed from the final output by the time it reached the recipient. To me, it seemed like this was bad behavor so I tried locating where the message could possibly be distorted and found the above-mentioned line to be the 'problem'.Due to time constraints, I couldn't dig any deeper into this and had to settle with disabling the function call since I didn't intend to input any HTML.
The problem is that
drupal_html_to_textdoesn't preserve linebreaks and if plain text output is required,simplenews_html_to_textis called regardless of whether the input contains any HTML or not.So basically, one has to actually input HTML-breaks so they can be turned into
\n.Comment #3
Danial Namousi commentedHere's an example. I select 'Message plain text' and input filter, enter the following in a textarea (without an editor):
And this is what I get:
Comment #4
sutharsan commentedI can't reproduce this either and therefore can not debug it. Closing the issue. Feel free to re-open if you have a way to reproduce the error.
Comment #5
Anonymous (not verified) commentedI encountered the same problem. It seems to be a problem with the input format.
I had to make sure to run the input through a "Line break converter" after the "HTML filter" for Drupal to add HTML line breaks.
Else, the resulting mails won't contain any line breaks.
To reproduce this, make sure to use an input format with the HTML filter set to remove all HTML formatting and do not use any additional filters so the resulting output is just plain text without any HTML formatting.