Merge pull request #2707 from coreos-inc/cancel-emails
Only send internal cancelation emails if the user canceled themselves
This commit is contained in:
commit
e9813711e3
1 changed files with 4 additions and 2 deletions
|
@ -46,6 +46,8 @@ def stripe_webhook():
|
||||||
change_type = ''
|
change_type = ''
|
||||||
if event_type.endswith('.deleted'):
|
if event_type.endswith('.deleted'):
|
||||||
plan_id = request_data['data']['object']['plan']['id']
|
plan_id = request_data['data']['object']['plan']['id']
|
||||||
|
requested = bool(request_data.get('request'))
|
||||||
|
if requested:
|
||||||
change_type = 'canceled %s' % plan_id
|
change_type = 'canceled %s' % plan_id
|
||||||
send_subscription_change(change_type, customer_id, cust_email, quay_username)
|
send_subscription_change(change_type, customer_id, cust_email, quay_username)
|
||||||
elif event_type.endswith('.created'):
|
elif event_type.endswith('.created'):
|
||||||
|
|
Reference in a new issue