I have a django template which I have to send as email body, the variables that i am sending are getting rendered in the email accordingly but the html tags used in the template are not rendering.Here is the code..
t = loader.get_template('registration/subscription_employee.html')
c = {'site_name': current_site.domain,'user': user,'employer':employer}
send_mail(("Subscription Agreement of %s")%data['username'], t.render(Context(c)), None, [settings.PAYPAL_PRIMARY_EMAIL,data['email']],fail_silently = True)
how can i ensure that html tags are also rendered accordingly.
You either need to use attach_alternative() or specify a content sub type for your message. See the docs on sending HTML emails: http://docs.djangoproject.com/en/1.3/topics/email/. The HTML-specific info is about halfway down the page. Hope that helps you out.