I am trying to send html emails to users and i have one html template.
html content starts with:
Dear XYZ, ..
how is it possible to change XYZ
with users name that i am sending this mail to? how can i crawl the html and change that name and do this?:
subject, from_email, to = 'subject', 'test@gmail.com', 'email'
html_content = render_to_string('the_template.html', {'varname':'value'}) # ...
text_content = strip_tags(html_content)
msg = EmailMultiAlternatives(subject, text_content, from_email, [to])
msg.attach_alternative(html_content, "text/html")
msg.send()
this would save me a month!