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

Add automated confirmation email #22

Open
EiffL opened this issue Jun 19, 2020 · 2 comments
Open

Add automated confirmation email #22

EiffL opened this issue Jun 19, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@EiffL
Copy link
Member

EiffL commented Jun 19, 2020

As requested by the committee, we need the registration server to send a confirmation email upon completion of the registration. We didn't have that feature before because we relied on the payment confirmation email.

I'm pretty sure Heroku has a service for that, otherwise the question is simply: how do I easily send an email from python?

@EiffL EiffL added the enhancement New feature or request label Jun 19, 2020
@EiffL
Copy link
Member Author

EiffL commented Jun 19, 2020

This might be the answer:
https://devcenter.heroku.com/articles/sendgrid#python

@EiffL
Copy link
Member Author

EiffL commented Jun 19, 2020

grrr you have to deposit a credit card number to use this... too bad because the python API is super easy:

import sendgrid
import os
from sendgrid.helpers.mail import *

sg = sendgrid.SendGridAPIClient(apikey=os.environ.get('SENDGRID_API_KEY'))
from_email = Email("[email protected]")
subject = "Hello World from the SendGrid Python Library!"
to_email = Email("[email protected]")
content = Content("text/plain", "Hello, Email!")
mail = Mail(from_email, subject, to_email, content)
response = sg.client.mail.send.post(request_body=mail.get())

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

No branches or pull requests

1 participant