I am attempting to get Mime Mail to handle the formatting of system messages on my site. It is fully capable of it however, all system email messages are in plain text format as a result all text is displayed in one paragraph without line breaks. How can I get it to display text with the paragraphs/line breaks included short of including the tags manually in each system message? Is there some sort of special PHP function that I can include in the tpl.php file?

I have the latest Dev version.

Comments

andros’s picture

+1

rbrownell’s picture

Category: bug » support
Status: Active » Fixed

So while building a new website (I encountered this problem while upgrading a D6 site to D7)... I installed the same combination of modules and even used slightly modified copies of the same template and css files. In the new site it worked... In the updated site it didn't work.

I did however somehow managed to fix the Upgraded site. Here are the steps I took:

  • I removed all unnecessary classes in the Mail System configuration and made sure to select MimeMailSystem for all the classes (except for custom classes that used custom mail handlers such as Commerce Invoice Receipt).
  • I disabled and uninstalled all Mime Mail modules
  • Cleared the cache
  • Re-enabled all Mime Mail modules

Correction: It turns out that Mime Mail reverted to the Plain Text input format and so HTML was not showing up... And now with HTML working, plain text is now not working. It seems to me that Mime Mail almost needs to create two mail systems in the Mail System module... MimeMailHTML and MimeMailPlainText...

Just a thought. If I have time I'll look into the code to see what it would take to do this.

-R

rbrownell’s picture

Category: support » bug
sgabe’s picture

It seems to me that the cause of this was module misconfiguration and can be marked as fixed.

rbrownell’s picture

Category: support » bug
Status: Fixed » Active

No. Its still an issue. Mime Mail is treating plain text format as simply one paragraph and not breaking at the line brakes... If this is a misconfiguration where can one configure the module so that it supports *both* HTML and plain text, text formats/filters?

andros’s picture

I would also like to know this. Where can I configure Mime Mail so that it's output is consistent HTML?

GiorgosK’s picture

maybe this can help
you canpick the E-mail format in admin/config/system/mimemail

and make sure that format is configured properly here admin/config/content/formats

andros’s picture

If it is set to HTML the problem occurs.
The problem is that plain text fields in Drupal, for what reason, never get there line breaks translated to HTML. This occurs on all Drupal core fields.

So for example in Rules you have the option to send mails with the core or with the Mime Mail module delivered HTML option, and you have to replace every single place where you send mails, with an Mime Mail HTML field.

But not all System messages can be replaced I think.

PascalAnimateur’s picture

What about creating another text format with the "Convert line break to HTML" filter and using that instead of HTML ?

andros’s picture

Look at the issue description and at #1, he speaks about system messages.

Have you ever tested this module out under production site conditions?

PascalAnimateur’s picture

I can confirm my solution from #9 works to correctly to format system messages.

I have Mime mail 7.x-1.0-alpha2+30-dev configured to send emails in Full HTML text format. When I enable the linebreak to HTML filter, the system message (reset user passsword) is ok. When I disable the linebreak to HTML filter, the same system message is displayed in one paragraph without breaks.

So if you need your HTML text format to somehow have that filter disabled (i.e. for source formatting), make a copy of it, assign it no role whatsoever then add the linebreak => HTML filter to it.

andros’s picture

@#11 this is intressting, but I don't get what you mean by create another text format?

Do you mean plain text? Yes I have there "Convert line breaks into HTML (i.e.
and

) " enabled.
I think this is standard. But this makes no difference for me. I'm using beta1.

PascalAnimateur’s picture

Under standard profile installation, Drupal comes with 3 text formats :

  • Plain text
  • Filtered HTML
  • Full HTML

When you configure Mime Mail to use Full HTML as its mail format, the system messages will have incorrect line breaks if the Full HTML text format doesn't have the Convert linebreaks to HTML filter enabled.

My suggestion was creating a 4th text format to use with mime mail if and only if you need Full HTML to have the linebreak filter disabled.

PascalAnimateur’s picture

Issue summary: View changes

included mention of the dev version

sgabe’s picture

Component: Miscellaneous » Documentation
Issue summary: View changes
Status: Active » Closed (fixed)

I have added a description with this information to the Email format field on the administration page.

dev.aleks’s picture

#13 PascalAnimateur
THANK YOU SIR! YOU SAVED MY DAY MAN!

Agiss’s picture

I've experienced the same when added this in the php.ini

zlib.output_compression = On

Site went back to normal when I removed it