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

Use postmark to send emails instead of Flask-Mail #169

Open
jonathan-kosgei opened this issue May 11, 2017 · 2 comments
Open

Use postmark to send emails instead of Flask-Mail #169

jonathan-kosgei opened this issue May 11, 2017 · 2 comments
Labels

Comments

@jonathan-kosgei
Copy link

Hi, how would I override Flask-User's use of Flask-Mail to send emails and replace it with a custom module. I need to use Postmark's REST API and not it's SMTP offering.

I'm thinking I could use signals to hook into events such as user_changed.password etc and send an email to the user based on that. But how do I switch off Flask-User's use of Flask-Mail?

@carrete
Copy link

carrete commented Aug 2, 2017

What if you set MAIL_SERVER to not.a.real.hostname? I understand that this isn't optimal. You could at least speed up the time to failure by adding an appropriate entry to /etc/hosts so you skip the needless DNS lookup.

@lingthio
Copy link
Owner

The UserManager() initialization accepts a custom 'send_email_function' that can point to your custom function.

See emails.py,
def send_email(recipient, subject, html_message, text_message)
for an example implementation using SMTP.

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

No branches or pull requests

3 participants