Respond to subscription change events so I can stop polling the stripe event list.
This commit is contained in:
parent
27072d4a2d
commit
d95c321e28
2 changed files with 23 additions and 1 deletions
|
@ -34,6 +34,14 @@ not given access. Please disregard this email.<br>
|
|||
"""
|
||||
|
||||
|
||||
SUBSCRIPTION_CHANGE = """
|
||||
Event name: {0}<br>
|
||||
Customer id: <a href="https://manage.stripe.com/customers/{1}">{1}</a><br>
|
||||
Customer email: <a href="mailto:{2}">{2}</a><br>
|
||||
Quay user or org name: {3}<br>
|
||||
"""
|
||||
|
||||
|
||||
def send_change_email(username, email, token):
|
||||
msg = Message('Quay.io email change. Please confirm your email.',
|
||||
sender='support@quay.io', # Why do I need this?
|
||||
|
@ -64,3 +72,11 @@ def send_invoice_email(email, contents):
|
|||
recipients=[email])
|
||||
msg.html = contents
|
||||
mail.send(msg)
|
||||
|
||||
|
||||
def send_subscription_change(event_name, customer_id, customer_email, quay_username):
|
||||
msg = Message('Quay.io Customer Subscription Change',
|
||||
sender='support@quay.io', # Why do I need this?
|
||||
recipients=['stripe@quay.io'])
|
||||
msg.html = SUBSCRIPTION_CHANGE.format(event_name, customer_id, customer_email, quay_username)
|
||||
mail.send(msg)
|
||||
|
|
Reference in a new issue