add trial information into welcome email

This commit is contained in:
Son NK 2020-01-30 13:54:33 +07:00
parent ad1cf3af8c
commit 01abc48f62
9 changed files with 35 additions and 19 deletions

View File

@ -41,7 +41,7 @@ def activate():
user = activation_code.user
user.activated = True
login_user(user)
email_utils.send_welcome_email(user.email, user.name)
email_utils.send_welcome_email(user)
# activation code is to be used only once
ActivationCode.delete(activation_code.id)

View File

@ -130,7 +130,7 @@ def facebook_callback():
db.session.commit()
login_user(user)
email_utils.send_welcome_email(user.email, user.name)
email_utils.send_welcome_email(user)
flash(f"Welcome to SimpleLogin {user.name}!", "success")

View File

@ -101,7 +101,7 @@ def github_callback():
)
db.session.commit()
login_user(user)
email_utils.send_welcome_email(user.email, user.name)
email_utils.send_welcome_email(user)
flash(f"Welcome to SimpleLogin {user.name}!", "success")

View File

@ -115,7 +115,7 @@ def google_callback():
db.session.commit()
login_user(user)
email_utils.send_welcome_email(user.email, user.name)
email_utils.send_welcome_email(user)
flash(f"Welcome to SimpleLogin {user.name}!", "success")

View File

@ -29,12 +29,12 @@ def _render(template_name, **kwargs) -> str:
return template.render(**kwargs)
def send_welcome_email(email, name):
def send_welcome_email(user):
send_email(
email,
f"Welcome to SimpleLogin {name}!",
_render("welcome.txt", name=name),
_render("welcome.html", name=name),
user.email,
f"Welcome to SimpleLogin {user.name}",
_render("welcome.txt", name=user.name, user=user),
_render("welcome.html", name=user.name, user=user),
)

View File

@ -36,6 +36,7 @@ app = create_app()
with app.app_context():
# to test email template
# with open("/tmp/email.html", "w") as f:
# f.write(_render("welcome.html", name="John Wick"))
# user = User.get(1)
# f.write(_render("welcome.html", user=user, name=user.name))
embed()

View File

@ -11,12 +11,16 @@
{{ render_text('To better secure your account, I recommend enabling Multi-Factor Authentication (MFA) on your <a href="https://app.simplelogin.io/dashboard/setting">Setting page</a>.') }}
{{ render_text('If you use Chrome or Firefox, SimpleLogin extension could be handy to quickly create aliases. Chrome extension can be installed on <a href="https://chrome.google.com/webstore/detail/simplelogin-your-anti-spa/dphilobhebphkdjbpfohgikllaljmgbn">Chrome Store</a> and Firefox on <a href="https://addons.mozilla.org/en-GB/firefox/addon/simplelogin/">Firefox Store</a>.') }}
{{ render_text('SimpleLogin browser extension could be handy to quickly manage aliases. Chrome (or other Chromium-based browsers like Brave or Vivaldi) extension can be installed on <a href="https://chrome.google.com/webstore/detail/simplelogin-your-anti-spa/dphilobhebphkdjbpfohgikllaljmgbn">Chrome Store</a>, Firefox on <a href="https://addons.mozilla.org/en-GB/firefox/addon/simplelogin/">Firefox Store</a> and Safari on <a href="https://apps.apple.com/us/app/simplelogin/id1494051017?mt=12&fbclid=IwAR0M0nnEKgoieMkmx91TSXrtcScj7GouqRxGgXeJz2un_5ydhIKlbAI79Io">AppStore</a>.') }}
{{ render_text('If you have a domain, for example for your business or your project, you can import your domain into SimpleLogin
and create your business emails backed by your personal email. This is cheaper and more convenient than buying a GSuite account. By the way, all our business emails are actually aliases :).') }}
and create your <b>business emails</b> using email alias. This is cheaper and more convenient than buying a dedicated solution like GSuite. By the way, all our business emails are actually aliases.') }}
{{ render_text('Importing domain is only available for Premium plan though, shoot me an email by replying to this email if you need a trial period.') }}
{% if user.in_trial() %}
{{ render_text('You can use all premium features like <em>custom domain</em> or <em>alias directory</em> during the <b>trial period</b>. Your trial will end ' + user.trial_end.humanize() + ".") }}
{% endif %}
{{ render_text('If there\'s anything that\'s bugging you, even the smallest of issues that could be done better, I want to hear about it - so hit the reply button.') }}
{% endblock %}

View File

@ -5,16 +5,27 @@ My name is Son. Im the founder of SimpleLogin and I wanted to be the first to
To better secure your account, I recommend enabling Multi-Factor Authentication (MFA) on your setting page at
https://app.simplelogin.io/dashboard/setting
If you use Chrome or Firefox, SimpleLogin extension could be quite handy to quickly create aliases.
You can install Chrome extension on
SimpleLogin browser extension could be handy to quickly manage aliases.
Chrome (or other Chromium-based browsers like Brave or Vivaldi) extension can be installed on:
https://chrome.google.com/webstore/detail/simplelogin-your-anti-spa/dphilobhebphkdjbpfohgikllaljmgbn
and Firefox on
Firefox on
https://addons.mozilla.org/en-GB/firefox/addon/simplelogin/
and Safari on
https://apps.apple.com/us/app/simplelogin/id1494051017?mt=12&fbclid=IwAR0M0nnEKgoieMkmx91TSXrtcScj7GouqRxGgXeJz2un_5ydhIKlbAI79Io
If you have a domain, for example for your business or your project, you can import your domain into SimpleLogin
and create your business emails backed by your personal email! By the way, all our business emails are actually aliases 🤫.
Importing domain is only available for Premium plan though, shoot me an email if you need a trial period.
and create your business emails backed by your personal email! By the way, all our business emails are actually aliases.
{% if user.in_trial() %}
You can use all premium features like custom domain or alias directory during the trial period.
Your trial will end {{ user.trial_end.humanize() }}.
{% endif %}
If there's anything that's bugging you, even the smallest of issues that could be done better, I want to hear about it - so hit the reply button.
Thanks.
Son - SimpleLogin founder.

View File

@ -26,7 +26,7 @@
</span>
{% if current_user.in_trial() %}
<small class="text-success d-block mt-1">Trial ends in {{ current_user.trial_end|dt }}</small>
<small class="text-success d-block mt-1">Trial ends {{ current_user.trial_end|dt }}</small>
{% elif current_user.lifetime_or_active_subscription() %}
<small class="text-success d-block mt-1">Premium</small>
{% endif %}