Dont nl2br the body

Created on 10 January 2023, almost 2 years ago
Updated 7 July 2023, over 1 year ago

Hello,
somehow before send at the moment the body is passed to nl2br, but this is wrong (sendinblue.mail.inc line 49).

Assuming we are sending html mail this will broke everything.
We should not nl2br or add a check if the mail is html like:

if(strpos($message['headers']['Content-Type'], 'text/html') === false ){
        $message['body'] = nl2br($message['body']);
      }
🐛 Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

🇮🇹Italy andrea.cavattoni

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇫🇷France xavier.masson Haute-Normandie

    I've occurred the same issue with my HTML e-mail template broken with break lines in the Twig template converted as
    HTML element. I've attached a patch to remove the usage of nl2br on the HTML body.

    Maybe the module can provides some processors who users can enable or disable to be compliant for everyone.

Production build 0.71.5 2024