Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template for HTML alternative #12

Open
SebCorbin opened this issue Jun 30, 2016 · 2 comments
Open

Template for HTML alternative #12

SebCorbin opened this issue Jun 30, 2016 · 2 comments

Comments

@SebCorbin
Copy link

SebCorbin commented Jun 30, 2016

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?

@mlavin
Copy link
Contributor

mlavin commented Jun 30, 2016

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.

@SebCorbin
Copy link
Author

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants