From af6025fec7eb9de854ad8b8e71d56fd7283ed0d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ensar=20Saraj=C4=8Di=C4=87?= Date: Wed, 31 Oct 2018 23:25:54 +0100 Subject: [PATCH] Improve email templates --- app/api/resources/account.py | 10 +- app/templates/activate_mail.html | 391 +++++++++++++++++++++++++++++- app/templates/welcome_to_iot.html | 385 ++++++++++++++++++++++++++++- 3 files changed, 775 insertions(+), 11 deletions(-) diff --git a/app/api/resources/account.py b/app/api/resources/account.py index 9cead0d..b36a49a 100644 --- a/app/api/resources/account.py +++ b/app/api/resources/account.py @@ -99,7 +99,7 @@ class AccountListResource(Resource): confirm_url=confirm_url) send_email_task.delay( args['email'], - 'Please confirm your email', + 'ETF IoT Email confirmation', html) return UserSchema().dump(created_account), 201 except ValueError: @@ -110,13 +110,15 @@ class AccountEmailTokenResource(Resource): def get(self, token): success, email = accounts.confirm_email_token(token) if success: + frontend_url = app.config['FRONTEND_URL'] html = render_template( - 'welcome_to_iot.html') + 'welcome_to_iot.html', + frontend_url=frontend_url) send_email_task.delay( email, - 'Welcome to IoT!', + 'Welcome to ETF IoT!', html) - return redirect(app.config['FRONTEND_URL']) + return redirect(frontend_url) class AccountEmailTokenResendResource(Resource): diff --git a/app/templates/activate_mail.html b/app/templates/activate_mail.html index 8634c07..3fad75a 100644 --- a/app/templates/activate_mail.html +++ b/app/templates/activate_mail.html @@ -1,4 +1,387 @@ -

Welcome! Thanks for signing up. Please follow this link to activate your account:

-

{{ confirm_url }}

-
-

Cheers!

+ + + + + + Please activate your email for ETF IoT + + + + + + + + + + + + diff --git a/app/templates/welcome_to_iot.html b/app/templates/welcome_to_iot.html index 0acc6c1..476cf80 100644 --- a/app/templates/welcome_to_iot.html +++ b/app/templates/welcome_to_iot.html @@ -1,3 +1,382 @@ -

Welcome! Thanks for signing up! You have successfully confirmed your email.

-
-

Cheers!

+ + + + + + Welcome to IoT! + + + + + + + + + + + +