-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
10 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,17 +14,11 @@ | |
|
||
def invoice_payment_failed(event, link="test"): | ||
print("processing invoice.payment_failed event...") | ||
print("sending mail...") | ||
user = event.customer.user | ||
if hasattr(user, "email"): | ||
target_email = user.email | ||
else: | ||
target_email = "[email protected]" | ||
send_mail( | ||
"Your Payment Failed", | ||
f"Please pay the invoice at: {link}", | ||
"[email protected]", | ||
[target_email], | ||
"Compute Studio", | ||
"Payment failed", | ||
"Compute Studio <[email protected]>", | ||
["[email protected]"], | ||
fail_silently=False, | ||
) | ||
|
||
|
@@ -33,9 +27,9 @@ def customer_created(event): | |
print("processing customer.created event...") | ||
customer = Customer.objects.get(stripe_id=event.data["object"]["id"]) | ||
send_mail( | ||
"Welcome to Compute Studio", | ||
"Thanks for joining!", | ||
"[email protected]", | ||
"Compute Studio", | ||
"Your payment method was set successfully! Please write back if you have any questions.", | ||
"Compute Studio <[email protected]>", | ||
[customer.user.email], | ||
fail_silently=False, | ||
) | ||
|