mirror of
https://github.com/simple-login/app.git
synced 2024-09-28 12:41:29 +02:00
Add browser extension onboarding email
This commit is contained in:
parent
85d36f2eac
commit
58ca77e2ae
@ -199,6 +199,7 @@ FLASK_PROFILER_PASSWORD = os.environ.get("FLASK_PROFILER_PASSWORD")
|
||||
JOB_ONBOARDING_1 = "onboarding-1"
|
||||
JOB_ONBOARDING_2 = "onboarding-2"
|
||||
JOB_ONBOARDING_3 = "onboarding-3"
|
||||
JOB_ONBOARDING_4 = "onboarding-4"
|
||||
|
||||
# for pagination
|
||||
PAGE_LIMIT = 20
|
||||
|
@ -19,6 +19,7 @@ from app.config import (
|
||||
JOB_ONBOARDING_1,
|
||||
JOB_ONBOARDING_2,
|
||||
JOB_ONBOARDING_3,
|
||||
JOB_ONBOARDING_4,
|
||||
)
|
||||
from app.extensions import db
|
||||
from app.log import LOG
|
||||
@ -187,6 +188,11 @@ class User(db.Model, ModelMixin, UserMixin):
|
||||
payload={"user_id": user.id},
|
||||
run_at=arrow.now().shift(days=3),
|
||||
)
|
||||
Job.create(
|
||||
name=JOB_ONBOARDING_4,
|
||||
payload={"user_id": user.id},
|
||||
run_at=arrow.now().shift(days=4),
|
||||
)
|
||||
db.session.flush()
|
||||
|
||||
return user
|
||||
|
@ -6,7 +6,12 @@ import time
|
||||
|
||||
import arrow
|
||||
|
||||
from app.config import JOB_ONBOARDING_1, JOB_ONBOARDING_2, JOB_ONBOARDING_3
|
||||
from app.config import (
|
||||
JOB_ONBOARDING_1,
|
||||
JOB_ONBOARDING_2,
|
||||
JOB_ONBOARDING_3,
|
||||
JOB_ONBOARDING_4,
|
||||
)
|
||||
from app.email_utils import send_email, render
|
||||
from app.extensions import db
|
||||
from app.log import LOG
|
||||
@ -48,6 +53,15 @@ def onboarding_pgp(user):
|
||||
)
|
||||
|
||||
|
||||
def onboarding_browser_extension(user):
|
||||
send_email(
|
||||
user.email,
|
||||
f"Do you know you can create aliases without leaving the browser?",
|
||||
render("com/onboarding/browser-extension.txt", user=user),
|
||||
render("com/onboarding/browser-extension.html", user=user),
|
||||
)
|
||||
|
||||
|
||||
def onboarding_mailbox(user):
|
||||
send_email(
|
||||
user.email,
|
||||
@ -103,6 +117,18 @@ if __name__ == "__main__":
|
||||
LOG.d("send onboarding pgp email to user %s", user)
|
||||
onboarding_pgp(user)
|
||||
|
||||
elif job.name == JOB_ONBOARDING_4:
|
||||
user_id = job.payload.get("user_id")
|
||||
user = User.get(user_id)
|
||||
|
||||
# user might delete their account in the meantime
|
||||
# or disable the notification
|
||||
if user and user.notification and user.activated:
|
||||
LOG.d(
|
||||
"send onboarding browser-extension email to user %s", user
|
||||
)
|
||||
onboarding_browser_extension(user)
|
||||
|
||||
else:
|
||||
LOG.error("Unknown job name %s", job.name)
|
||||
|
||||
|
22
templates/emails/com/onboarding/browser-extension.html
Normal file
22
templates/emails/com/onboarding/browser-extension.html
Normal file
@ -0,0 +1,22 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
{{ render_text("Hi " + user.name) }}
|
||||
|
||||
{{ render_text('If you want to quickly create aliases without going to SimpleLogin website, you can do that with SimpleLogin <a href="https://chrome.google.com/webstore/detail/simplelogin-your-anti-spa/dphilobhebphkdjbpfohgikllaljmgbn">Chrome</a> (or other Chromium-based browsers like Brave or Vivaldi), <a href="https://addons.mozilla.org/en-GB/firefox/addon/simplelogin/">Firefox</a> and <a href="https://apps.apple.com/us/app/simplelogin/id1494051017?mt=12&fbclid=IwAR0M0nnEKgoieMkmx91TSXrtcScj7GouqRxGgXeJz2un_5ydhIKlbAI79Io
|
||||
">Safari</a> extension.
|
||||
') }}
|
||||
|
||||
{{ render_text("The Android and iOS apps are also coming. To try out our iOS beta version, please reply to this email so we can invite you our TestFlight program.
|
||||
") }}
|
||||
|
||||
{{ render_text('Thanks, <br />SimpleLogin Team.') }}
|
||||
{{ render_text('<strong>P.S.</strong> Need immediate help getting started? Just reply to this email, the SimpleLogin support team is always ready to help!.') }}
|
||||
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block footer %}
|
||||
This email is sent to {{ user.email }} and is part of our onboarding series. Unsubscribe on
|
||||
<a href="https://app.simplelogin.io/dashboard/setting#notification">Settings</a>
|
||||
{% endblock %}
|
22
templates/emails/com/onboarding/browser-extension.txt
Normal file
22
templates/emails/com/onboarding/browser-extension.txt
Normal file
@ -0,0 +1,22 @@
|
||||
This email is sent to {{ user.email }} and is part of our onboarding series.
|
||||
Unsubscribe from our emails on https://app.simplelogin.io/dashboard/setting#notification
|
||||
----------------
|
||||
|
||||
Hi {{user.name}}
|
||||
|
||||
If you want to quickly create aliases without going to SimpleLogin website, you can do that with SimpleLogin Chrome (or other Chromium-based browsers like Brave or Vivaldi), Firefox and Safari extension.
|
||||
|
||||
Chrome: https://chrome.google.com/webstore/detail/simplelogin-your-anti-spa/dphilobhebphkdjbpfohgikllaljmgbn
|
||||
|
||||
Firefox: https://addons.mozilla.org/en-GB/firefox/addon/simplelogin/
|
||||
|
||||
Safari: https://apps.apple.com/us/app/simplelogin/id1494051017?mt=12&fbclid=IwAR0M0nnEKgoieMkmx91TSXrtcScj7GouqRxGgXeJz2un_5ydhIKlbAI79Io
|
||||
|
||||
The Android and iOS apps are also coming.
|
||||
|
||||
To try out our iOS beta version, please reply to this email so we can invite you our TestFlight program.
|
||||
|
||||
As usual, let us know if you have any question by replying to this email.
|
||||
|
||||
Best regards,
|
||||
SimpleLogin team.
|
Loading…
Reference in New Issue
Block a user