django-email-bandit
django-email-bandit copied to clipboard
Template for HTML alternative
Hello, great package!
I've successfully installed it and it works, but when sending an e-mail with HTML alternative, I have no way to know which was the original recipient (except if I look at the raw source):
I wonder if it would be possible to add a template tag or something like that for when bandit intercepts an email with HTML alternative?
Yes it would be helpful to see this info for HTML emails as well but it's going to be harder to build a template which doesn't break the original mail. I don't have a clever solution for this myself but it would be a nice addition.
How about something like developer puts in its template:
<!-- BANDIT_PLACEHOLDER -->
And during replacement:
if message.alternatives and len(message.alternatives):
for alt, mimetype in message.alternatives:
alt.replace('<!-- BANDIT_PLACEHOLDER -->', header)