send email to ask for user feedback when user cancels

This commit is contained in:
Son NK 2020-09-11 18:39:57 +02:00
parent c625a178e8
commit 2fba4c9a53
2 changed files with 27 additions and 4 deletions

View File

@ -54,7 +54,7 @@ from app.config import (
from app.dashboard.base import dashboard_bp
from app.developer.base import developer_bp
from app.discover.base import discover_bp
from app.email_utils import send_email
from app.email_utils import send_email, render
from app.extensions import db, login_manager, migrate, limiter
from app.jose_utils import get_jwk_key
from app.log import LOG
@ -571,11 +571,18 @@ def setup_paddle_callback(app: Flask):
sub.cancelled = True
db.session.commit()
user = sub.user
send_email(
ADMIN_EMAIL,
subject=f"{sub.user} cancels",
plaintext=f"{sub} {request.form.get('cancellation_effective_date')}",
user.email,
f"SimpleLogin - what can we do to improve the product?",
render(
"transactional/subscription-cancel.txt",
name=user.name or "",
end_date=request.form.get("cancellation_effective_date"),
),
)
else:
return "No such subscription", 400
elif request.form.get("alert_name") == "subscription_updated":

View File

@ -0,0 +1,16 @@
Hi {{name}}
This is Son, SimpleLogin founder. I saw that you have canceled your subscription.
Your subscription will end at {{end_date}}.
I would appreciate if you could tell me what we can do to improve the product or what is missing?
Thanks for giving SimpleLogin a try!
Best,
Son.
-----------------------------------------
Son NK - SimpleLogin founder.
https://simplelogin.io