From f860471d507478d0f6e36ceab1297c8aba6d5864 Mon Sep 17 00:00:00 2001 From: Son NK Date: Sat, 11 Jan 2020 21:48:21 +0100 Subject: [PATCH 1/5] fix slash in url: use alias_id instead of alias --- app/dashboard/templates/dashboard/alias_log.html | 8 ++++++-- app/dashboard/templates/dashboard/index.html | 2 +- app/dashboard/views/alias_log.py | 10 ++++++---- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/app/dashboard/templates/dashboard/alias_log.html b/app/dashboard/templates/dashboard/alias_log.html index 130a37b5..ef98b165 100644 --- a/app/dashboard/templates/dashboard/alias_log.html +++ b/app/dashboard/templates/dashboard/alias_log.html @@ -133,8 +133,12 @@ {% endblock %} diff --git a/app/dashboard/templates/dashboard/index.html b/app/dashboard/templates/dashboard/index.html index 22aae7c1..66048a32 100644 --- a/app/dashboard/templates/dashboard/index.html +++ b/app/dashboard/templates/dashboard/index.html @@ -111,7 +111,7 @@ {{ alias_info.nb_forward }} forwards, {{ alias_info.nb_blocked }} blocks, {{ alias_info.nb_reply }} replies - See All Activity  ā†’ diff --git a/app/dashboard/views/alias_log.py b/app/dashboard/views/alias_log.py index 6878b130..efbde712 100644 --- a/app/dashboard/views/alias_log.py +++ b/app/dashboard/views/alias_log.py @@ -22,11 +22,13 @@ class AliasLog: setattr(self, k, v) -@dashboard_bp.route("/alias_log/", methods=["GET"], defaults={"page_id": 0}) -@dashboard_bp.route("/alias_log//") +@dashboard_bp.route( + "/alias_log/", methods=["GET"], defaults={"page_id": 0} +) +@dashboard_bp.route("/alias_log//") @login_required -def alias_log(alias, page_id): - gen_email = GenEmail.get_by(email=alias) +def alias_log(alias_id, page_id): + gen_email = GenEmail.get(alias_id) # sanity check if not gen_email: From 5eb4783be2601b2332e945c8f91ac688f92b7990 Mon Sep 17 00:00:00 2001 From: Son NK Date: Sat, 11 Jan 2020 22:21:58 +0100 Subject: [PATCH 2/5] better welcome email --- templates/emails/welcome.html | 16 +++++++++++++--- templates/emails/welcome.txt | 19 +++++++++++++++---- 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/templates/emails/welcome.html b/templates/emails/welcome.html index 03f599bb..3ad5777d 100644 --- a/templates/emails/welcome.html +++ b/templates/emails/welcome.html @@ -1,8 +1,18 @@ {% extends "base.html" %} {% block content %} - {{ render_text("Welcome " + name + " šŸŽ‰!") }} - {{ render_text("I really appreciate you signing up for SimpleLogin, and I'm sure you'll love it when you see how *simple* it is to use.") }} - {{ render_text("We built SimpleLogin to help people protecting their online identity, and I hope that we can achieve that for you.") }} + {{ render_text("Hi " + name) }} + + {{ render_text("My name is Son. Iā€™m the founder of SimpleLogin and I wanted to be the first to welcome you on board.") }} + + {{ render_text('To better secure your account, I recommend enabling Multi-Factor Authentication (MFA) on your Setting page.') }} + + {{ render_text('If you use Chrome or Firefox, SimpleLogin extension could be quite handy to quickly create aliases. Chrome extension can be installed on Chrome Store and Firefox on Firefox Store.') }} + + {{ 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 :).') }} + + {{ render_text('Importing domain is only available for Premium plan though, shoot me an email if you need a trial period.') }} + {% endblock %} diff --git a/templates/emails/welcome.txt b/templates/emails/welcome.txt index 4cb4a865..eb8bbed2 100644 --- a/templates/emails/welcome.txt +++ b/templates/emails/welcome.txt @@ -1,9 +1,20 @@ -Welcome {{name}} šŸŽ‰! +Hi {{name}} -I really appreciate you signing up for SimpleLogin, and I'm sure you'll love it when you see how *simple* it is to use. +My name is Son. Iā€™m the founder of SimpleLogin and I wanted to be the first to welcome you on board. -We built SimpleLogin to help people protecting their online identity, and I hope that we can achieve that for you. +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 +https://chrome.google.com/webstore/detail/simplelogin-your-anti-spa/dphilobhebphkdjbpfohgikllaljmgbn + +and Firefox on +https://addons.mozilla.org/en-GB/firefox/addon/simplelogin/ + +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. Thanks. - Son - SimpleLogin founder. From 8c9512e61e730a50de2625b8ef158da28e4e15f3 Mon Sep 17 00:00:00 2001 From: Son NK Date: Sat, 11 Jan 2020 22:26:59 +0100 Subject: [PATCH 3/5] do not ask for user name when register --- app/auth/templates/auth/register.html | 6 ------ app/auth/views/register.py | 3 +-- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/app/auth/templates/auth/register.html b/app/auth/templates/auth/register.html index 924de075..49b934a0 100644 --- a/app/auth/templates/auth/register.html +++ b/app/auth/templates/auth/register.html @@ -22,12 +22,6 @@
{{ form.csrf_token }}
-
- - {{ form.name(class="form-control") }} - {{ render_field_errors(form.name) }} -
-
{{ form.email(class="form-control", type="email") }} diff --git a/app/auth/views/register.py b/app/auth/views/register.py index bb5b3b11..046562b9 100644 --- a/app/auth/views/register.py +++ b/app/auth/views/register.py @@ -17,7 +17,6 @@ class RegisterForm(FlaskForm): password = StringField( "Password", validators=[validators.DataRequired(), validators.Length(min=8)] ) - name = StringField("Name", validators=[validators.DataRequired()]) @auth_bp.route("/register", methods=["GET", "POST"]) @@ -47,7 +46,7 @@ def register(): LOG.debug("create user %s", form.email.data) user = User.create( email=form.email.data.lower(), - name=form.name.data, + name="", password=form.password.data, ) db.session.commit() From 356b95ef809d362de7cc5dc3ca39d08c1007ba14 Mon Sep 17 00:00:00 2001 From: Son NK Date: Sat, 11 Jan 2020 22:28:06 +0100 Subject: [PATCH 4/5] fix formatting --- app/auth/views/register.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/auth/views/register.py b/app/auth/views/register.py index 046562b9..8e706942 100644 --- a/app/auth/views/register.py +++ b/app/auth/views/register.py @@ -45,9 +45,7 @@ def register(): else: LOG.debug("create user %s", form.email.data) user = User.create( - email=form.email.data.lower(), - name="", - password=form.password.data, + email=form.email.data.lower(), name="", password=form.password.data, ) db.session.commit() From d5dd46f4b10d3296a889385c7392e4504dbc3c7d Mon Sep 17 00:00:00 2001 From: Son NK Date: Sat, 11 Jan 2020 22:33:25 +0100 Subject: [PATCH 5/5] Fix email title as name now can be empty --- app/email_utils.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/email_utils.py b/app/email_utils.py index 57d853eb..b9e1f7ab 100644 --- a/app/email_utils.py +++ b/app/email_utils.py @@ -30,7 +30,7 @@ def _render(template_name, **kwargs) -> str: def send_welcome_email(email, name): send_email( email, - f"{name}, welcome to SimpleLogin!", + f"Welcome to SimpleLogin {name}!", _render("welcome.txt", name=name), _render("welcome.html", name=name), ) @@ -39,7 +39,7 @@ def send_welcome_email(email, name): def send_activation_email(email, name, activation_link): send_email( email, - f"{name}, just one more step to join SimpleLogin", + f"Just one more step to join SimpleLogin {name}", _render( "activation.txt", name=name, activation_link=activation_link, email=email ), @@ -52,7 +52,7 @@ def send_activation_email(email, name, activation_link): def send_reset_password_email(email, name, reset_password_link): send_email( email, - f"{name}, reset your password on SimpleLogin", + f"Reset your password on SimpleLogin", _render( "reset-password.txt", name=name, reset_password_link=reset_password_link ), @@ -65,7 +65,7 @@ def send_reset_password_email(email, name, reset_password_link): def send_change_email(new_email, current_email, name, link): send_email( new_email, - f"{name}, confirm email update on SimpleLogin", + f"Confirm email update on SimpleLogin", _render( "change-email.txt", name=name, @@ -86,7 +86,7 @@ def send_change_email(new_email, current_email, name, link): def send_new_app_email(email, name): send_email( email, - f"{name}, any question/feedback for SimpleLogin?", + f"Any question/feedback for SimpleLogin {name}?", _render("new-app.txt", name=name), _render("new-app.html", name=name), ) @@ -95,7 +95,7 @@ def send_new_app_email(email, name): def send_test_email_alias(email, name): send_email( email, - f"{name}, this email is sent to {email}", + f"This email is sent to {email}", _render("test-email.txt", name=name, alias=email), _render("test-email.html", name=name, alias=email), )