0

How can I keep new lines in a Django's EmailMessage that has a content_type = 'html'?

I need the html content type because of signatures.

Email:

Welcome User,

this is a welcome email.

Is rendered properly when sent as a text but when sent as an html, it (obviously) doesn't render newlines.

Email:

Welcome User,this is a welcome email.

I'd like to have just a plain text in my templates but I'd like them to be converted into html with proper newlines.

Is there a way to do that or do I need to write html tags myself?

Milano
  • 18,048
  • 37
  • 153
  • 353

1 Answers1

0

If you are using the django.core.mail module, then I suppose you are using the send_mail method.

As described in the link, you can use the html_message parameter, but this renders HTML code, so in this case you need to add the new lines with html tags.

videap
  • 66
  • 5