send email to ask for user feedback when user cancels
This commit is contained in:
parent
c625a178e8
commit
2fba4c9a53
15
server.py
15
server.py
|
@ -54,7 +54,7 @@ from app.config import (
|
||||||
from app.dashboard.base import dashboard_bp
|
from app.dashboard.base import dashboard_bp
|
||||||
from app.developer.base import developer_bp
|
from app.developer.base import developer_bp
|
||||||
from app.discover.base import discover_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.extensions import db, login_manager, migrate, limiter
|
||||||
from app.jose_utils import get_jwk_key
|
from app.jose_utils import get_jwk_key
|
||||||
from app.log import LOG
|
from app.log import LOG
|
||||||
|
@ -571,11 +571,18 @@ def setup_paddle_callback(app: Flask):
|
||||||
sub.cancelled = True
|
sub.cancelled = True
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
|
||||||
|
user = sub.user
|
||||||
|
|
||||||
send_email(
|
send_email(
|
||||||
ADMIN_EMAIL,
|
user.email,
|
||||||
subject=f"{sub.user} cancels",
|
f"SimpleLogin - what can we do to improve the product?",
|
||||||
plaintext=f"{sub} {request.form.get('cancellation_effective_date')}",
|
render(
|
||||||
|
"transactional/subscription-cancel.txt",
|
||||||
|
name=user.name or "",
|
||||||
|
end_date=request.form.get("cancellation_effective_date"),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
return "No such subscription", 400
|
return "No such subscription", 400
|
||||||
elif request.form.get("alert_name") == "subscription_updated":
|
elif request.form.get("alert_name") == "subscription_updated":
|
||||||
|
|
|
@ -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
|
Loading…
Reference in New Issue