I'm so baffled... I keep staring at this code, looking for the typo, but I can't find it!
template = 'emails/transporter_joined'
tt = loader.get_template(template+'.txt')
c = Context({'user':user, 'fee': settings.FEE * Decimal('100.00'),'settings':settings})
e = EmailMultiAlternatives('Activate Your Account', tt.render(c), '
[email protected]', [user.email])
try:
ht = loader.get_template(template+'.html')
e.attach_alternative(ht.render(c), 'text/html')
except:
pass
e.send()
First it should load the 'emails/transporter_joined.txt' template, and adds that to the email. And then it tries to load a '.html' version and attaches that too.
In Gmail you can see the the "original email" with both emails, and all the headers in plain text. It very clearly shows the .txt version twice. the .html and .txt files are definitely different. What am I doing wrong here?
If I replace this
tt = loader.get_template(template+'.txt')
With .html instead, then it sends the .html twice... it must be Django that'
s screwing up, no?