do not send double subscription email
This commit is contained in:
parent
aac493ad2f
commit
0795fa1bc5
3 changed files with 0 additions and 81 deletions
|
@ -50,36 +50,6 @@ class LinkResult:
|
||||||
strategy: str
|
strategy: str
|
||||||
|
|
||||||
|
|
||||||
def send_double_subscription_if_needed(partner_user: PartnerUser):
|
|
||||||
sub = partner_user.user.get_active_subscription()
|
|
||||||
if isinstance(sub, AppleSubscription):
|
|
||||||
channel = "Apple"
|
|
||||||
elif isinstance(sub, Subscription):
|
|
||||||
channel = "Paddle"
|
|
||||||
else:
|
|
||||||
return
|
|
||||||
send_email_at_most_times(
|
|
||||||
partner_user.user,
|
|
||||||
config.ALERT_DUAL_SUBSCRIPTION_WITH_PARTNER,
|
|
||||||
partner_user.user.email,
|
|
||||||
f"You have two subscriptions in SimpleLogin",
|
|
||||||
render(
|
|
||||||
"transactional/double-subscription-partner.txt.jinja2",
|
|
||||||
is_proton=is_proton_partner(partner_user.partner),
|
|
||||||
partner=partner_user.partner,
|
|
||||||
subscription_channel=channel,
|
|
||||||
cancel_link=url_for("dashboard.billing"),
|
|
||||||
),
|
|
||||||
render(
|
|
||||||
"transactional/double-subscription-partner.html",
|
|
||||||
is_proton=is_proton_partner(partner_user.partner),
|
|
||||||
partner=partner_user.partner,
|
|
||||||
subscription_channel=channel,
|
|
||||||
cancel_link=url_for("dashboard.billing"),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def set_plan_for_partner_user(partner_user: PartnerUser, plan: SLPlan):
|
def set_plan_for_partner_user(partner_user: PartnerUser, plan: SLPlan):
|
||||||
sub = PartnerSubscription.get_by(partner_user_id=partner_user.id)
|
sub = PartnerSubscription.get_by(partner_user_id=partner_user.id)
|
||||||
if plan.type == SLPlanType.Free:
|
if plan.type == SLPlanType.Free:
|
||||||
|
@ -108,7 +78,6 @@ def set_plan_for_partner_user(partner_user: PartnerUser, plan: SLPlan):
|
||||||
"PlanChange", {"plan": "premium", "type": "extension"}
|
"PlanChange", {"plan": "premium", "type": "extension"}
|
||||||
)
|
)
|
||||||
sub.end_at = plan.expiration
|
sub.end_at = plan.expiration
|
||||||
send_double_subscription_if_needed(partner_user)
|
|
||||||
Session.commit()
|
Session.commit()
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,28 +0,0 @@
|
||||||
{% extends "base.html" %}
|
|
||||||
|
|
||||||
{% block content %}
|
|
||||||
{% call text() %}
|
|
||||||
Hi,
|
|
||||||
{% endcall %}
|
|
||||||
|
|
||||||
{% call text() %}
|
|
||||||
{% if is_proton %}
|
|
||||||
As a Proton user with a paid mail subscription you can have SimpleLogin premium for free, thanks to the SimpleLogin Proton integration.<br>
|
|
||||||
{% else %}
|
|
||||||
{{ partner.name }} has upgraded your account to premium.<br>
|
|
||||||
{% endif %}
|
|
||||||
You currently have a paid SimpleLogin subscription via {{ subscription_channel }}.<br>
|
|
||||||
{% if subscription_channel == 'apple' %}
|
|
||||||
You can cancel it to avoid automatic renewal on your Apple iCloud account page.
|
|
||||||
You can find more info <a href="https://support.apple.com/en-us/HT202039">here</a>.<br>
|
|
||||||
{% elif subscription_channel == 'paddle' %}
|
|
||||||
You can cancel it to avoid automatic renewal on <a href="{{ cancel_link }}">{{ cancel_link }}</a>.<br>
|
|
||||||
{% endif %}
|
|
||||||
You can also keep both subscriptions. In this case there’s nothing to do.
|
|
||||||
{% endcall %}
|
|
||||||
|
|
||||||
{% call text() %}
|
|
||||||
Best, <br>
|
|
||||||
SimpleLogin team.
|
|
||||||
{% endcall %}
|
|
||||||
{% endblock %}
|
|
|
@ -1,22 +0,0 @@
|
||||||
{% extends "base.txt.jinja2" %}
|
|
||||||
|
|
||||||
{% block content %}
|
|
||||||
Hi,
|
|
||||||
|
|
||||||
{% if is_proton -%}
|
|
||||||
As a Proton user with a paid mail subscription you can have SimpleLogin premium for free, thanks to the SimpleLogin Proton integration.
|
|
||||||
{% else -%}}
|
|
||||||
{{ partner.name }} has upgraded your account to premium.
|
|
||||||
{% endif -%}
|
|
||||||
You currently have a paid SimpleLogin subscription via {subscription_channel}.
|
|
||||||
{% if subscription_channel == 'Apple' %}
|
|
||||||
You can cancel it to avoid automatic renewal on your Apple iCloud account page.
|
|
||||||
Please find more info at https://support.apple.com/en-us/HT202039
|
|
||||||
{% elif subscription_channel == 'Paddle' %}
|
|
||||||
You can cancel it to avoid automatic renewal on {{ cancel_link }}.
|
|
||||||
{% endif %}
|
|
||||||
You can also keep both subscriptions. In this case there’s nothing to do.
|
|
||||||
|
|
||||||
Best,
|
|
||||||
SimpleLogin team.
|
|
||||||
{% endblock %}
|
|
Loading…
Add table
Reference in a new issue