Since Django 1.7 has come out things have changed a bit. Im trying to use 'send_mail' to send a HTML email.
I want to send a thank you email to users after signing up to my site.
Im using
subject = 'Thank you from ******'
message = 'text version of HTML message'
from_email = my email address
to_list = users email address
html_message= really long set of html code
send_mail(subject,message,from_email,to_list,fail_silently=True,html_message=html_message)
Is it possible to store the html as a file on the server and then convert it into a string so that it can be fed into 'html_message'?
Yes, you can. In my own project, I use the following code to do the same thing:
And the html file looks like this: