On Tuesday, November 2, 2010 5:50:49 AM UTC-4, Tom Evans wrote: > > On Tue, Nov 2, 2010 at 9:07 AM, andy <flow...@gmail.com <javascript:>> > wrote: > > I recently tried to send the following in a test password email from a > > site I am creating: > > > > <h1>This is a test reset password email.</h1> > > > > However when I received the email it displayed the "<h1>This is a test > > reset password email.</h1>". > > > > My question is how can I send a styled email using html tags and > > possibly even css when using the password_reset_email.html template > > that goes with django's view.password_reset? > > > > I don't know about the specifics of your particular issues, but to > send HTML emails: > > Create an instance of django.core.mail.EmailMultiAlternatives, passing > in your subject, text version of the email, from address, list of > recipients. Render your HTML version of the email, and attach it to > the email, and then send it. > > eg: > > from django.core.mail import EmailMultiAlternatives > msg = EmailMultiAlternatives('Subject', 'This is the text version', > 'fr...@address.com <javascript:>', [ 'recip...@address.com <javascript:> > ',]) > html_version = ... > msg.attach_alternative(html_version, 'text/html') > msg.send() >
I am having the same issue, but it's not clear to me how to implement your solution. I have added the files password_reset_email.html, activation_email_subject.txt, password_reset_form.html, and password_reset_done.html to my ui/templates/registration dir customized them as needed. Where would I put your code above? Where would I call it from? Thanks! -larry -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/XWUCrdk3uagJ. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.