Update the subscription change webhook to be more friendly and not send emails for payments.
This commit is contained in:
parent
05b3851a54
commit
a0cbead5aa
2 changed files with 25 additions and 7 deletions
|
@ -35,12 +35,14 @@ not given access. Please disregard this email.<br>
|
|||
|
||||
|
||||
SUBSCRIPTION_CHANGE = """
|
||||
Event name: {0}<br>
|
||||
Change: {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>
|
||||
"""
|
||||
|
||||
SUBSCRIPTION_CHANGE_TITLE = 'Subscription Change - {0} {1}'
|
||||
|
||||
|
||||
def send_change_email(username, email, token):
|
||||
msg = Message('Quay.io email change. Please confirm your email.',
|
||||
|
@ -74,9 +76,9 @@ def send_invoice_email(email, 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)
|
||||
def send_subscription_change(change_description, customer_id, customer_email, quay_username):
|
||||
title = SUBSCRIPTION_CHANGE_TITLE.format(quay_username, change_description)
|
||||
msg = Message(title, sender='support@quay.io', recipients=['stripe@quay.io'])
|
||||
msg.html = SUBSCRIPTION_CHANGE.format(change_description, customer_id, customer_email,
|
||||
quay_username)
|
||||
mail.send(msg)
|
||||
|
|
Reference in a new issue