Registration emails aren't displayed correctly for the user

7 years 11 months ago #281385 by entumas
Hi!

When someone signs up on my site, messages that confirm the registration and subsequent validation arrive without line breaks.
It's funny because those who come to me telling me that there are new records, come to me properly with line breaks.

Does anyone know that this is due and how can I fix it?

Thanks!

Please Log in to join the conversation.

7 years 10 months ago #282089 by villy
Hi

In Configuration - Registration tab, have you set Registration Email HTML to Yes?

Please Log in to join the conversation.

7 years 10 months ago #282097 by sekelfek
When you have set Registration Emails to HTML, than use <br> for line breaks.

Please Log in to join the conversation.

7 years 10 months ago #282236 by entumas
Hi! First of all wanted to apologize, I do not know why but this forum don't notify me of new replies.


villy wrote: Hi

In Configuration - Registration tab, have you set Registration Email HTML to Yes?

Yes


sekelfek wrote: When you have set Registration Emails to HTML, than use <br> for line breaks.

My website is multi-language, that is why I am using the message that come standard in Community Builder. These messages do not use <br>, use \r and \n, I thought that the line breaks should be \r and \n.
Thanks for pointing sekelfek :)

Please Log in to join the conversation.

7 years 10 months ago - 7 years 10 months ago #282259 by sekelfek
OK entumas, here the same problem with "\n" for line break.
I have observed the same thing.

My configuration:
CB 2.0.14
PHP-Version 5.5.5
Webserver Apache/2.2.15 (CentOS)
Joomla!-Version Joomla! 3.5.1 Stable [ Unicorn ]
Joomla!-Plattform-Version Joomla Platform 13.1.0 Stable [ Curiosity ]

THE PROBLEM:
"\n" is entered as a line break in some values in the "/components/com_comprofiler/plugin/language/default_language/language.php".
From PHP work, programming with Formmailer and work with notepad++ I know that with the "\n" for line break.

"\n" or "\r" or "\r\n" is for line break in plain text.

In the CB Formmailer "/libraries/CBLib/CBPHPMailer/CBPHPMailer.php" the "Content-type" setting have this PHP-Code:
/**
     * Sets message type to HTML or plain.
     * @param boolean $isHtml True for HTML mode.
     * @return void
     */
    public function isHTML($isHtml = true)
    {
        if ($isHtml) {
            $this->ContentType = 'text/html';
        } else {
            $this->ContentType = 'text/plain';
        }
    }

Line break by "text/html; charset=UTF-8" is "<br>"
Line break by "text/plain; charset=UTF-8". is "\n" or "\r" or "\r\n".

The "Registration Email HTML setting to Yes / NO" has something to do with it.

The best solution that I propose is:
"Registration Email HTML set to NO" and use for linebreak "\n" or "\r" or "\r\n" in the language.php AND normal line break with the Escape Key for the Registrations and Welcome Email in the Amdin Area Backend Formfield.
Why: Email is not for HTML!
(\n and \r is for different Operating Systems)

Another solution may be:
"Registration Email HTML set to YES" and replace in the language.php all "\n" or "\r" or "\r\n" to <br> for line break. OR write normal line breaks with the Escape Key.
Use CB Language Override. (search for tutorial).

I've tested now once.

If "Registration Email HTML set to YES" and in the file language.php the "\n" by "<br>" replaced, then line breaks are set in the email. (Content-Type: text/html; charset=UTF-8)

If "Registration Email HTML set to NO" and in the language.php file are "\n", then line breaks are set in the email. (Content-Type: text/plain; charset=UTF-8)
But when used in the Admin Area in Backend at the Registration and welcome email <br>, in these emails will not work the linebreaks.

Is one of two different, then it does not work.

ATTENTION: "\n" don't work in the Admin Area Backend Formfields for Registration-Emails, when is set to HTML NO. Use normal line breaks with Escape Key.

I advise to "Registration Email HTML set to NO". This saves the rewrite of language.php.

There is definitely a CB bug / conflict with language.php


PS: "notify me of new replies".
On the TOP of these site you have a bottom with "subscribe" or "unsubscribe". ;)
Or visit your Profile here and the Notify settings.

Please Log in to join the conversation.

7 years 10 months ago #282266 by nant

sekelfek wrote: There is definitely a CB bug / conflict with language.php


Please justify this as I cannot understand your reasoning.

Regarding other parts I do understand:

use \r\n for non-html emails.. use <br /> for html emails..

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.229 seconds

Facebook Twitter LinkedIn