0

I'm using a Symfony translation file and Mailer Bundle to send an email that serves in password resetting in the following format:

      <trans-unit id="resetting.email.message">
        <source>resetting.email.message</source>
        <target>
          Hello %username%!
        
          To reset your password - please visit %confirmationUrl%

          Regards,
          the Team.
        </target>
      </trans-unit>

I'm using hMailServer as a local mail server and Roundcube for email display. The problem is that I am receiving the email in the following format:

Hello %username%! To reset your password - please visit %confirmationUrl% Regards, the Team.

(The variables username and confirmationUrl are substituted I'm just showing how the email is being sent).

As you can see, the line breaks are ignored. How can I solve it ?

  • Break the translation unit into smaller parts and add HTML line breaks in your template ? – AymDev Mar 31 '23 at 13:26
  • Are you sending it as a HTML email or a plain text email? If it's a HTML email, then you need to add the line breaks using HTML (`
    `) or use (`

    ...

    `) for the different paragraphs. Ordinary line breaks aren't rendered in a HTML view.
    – M. Eriksson Mar 31 '23 at 13:45
  • Thank you guys I solved it. So instead of sending a HTML email, I switched off the HTML display in roundcube and the line breaks are being formatted without the need to add HTML tags. – codeWanderer Mar 31 '23 at 14:13

1 Answers1

0

So instead of sending a HTML email, I switched off the HTML display in roundcube and the line breaks are being formatted without the need to add HTML tags.
(HTML display was on by default)