From 0bea79dc8636aa3a1e7e73146cebb9adb83f6e99 Mon Sep 17 00:00:00 2001 From: Son NK Date: Mon, 3 Feb 2020 13:51:43 +0700 Subject: [PATCH] add send_safari_extension_newsletter() to shell --- shell.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/shell.py b/shell.py index 49d28955..004dd802 100644 --- a/shell.py +++ b/shell.py @@ -3,10 +3,9 @@ from IPython import embed from sqlalchemy_utils import create_database, database_exists, drop_database from app.config import DB_URI -from app.email_utils import _render +from app.email_utils import send_email, render from app.models import * from server import create_app -from app import email_utils def create_db(): @@ -31,6 +30,16 @@ def reset_db(): create_db() +def send_safari_extension_newsletter(): + for user in User.query.all(): + send_email( + user.email, + "Quickly create alias with our Safari extension", + render("com/safari-extension.txt", user=user), + render("com/safari-extension.html", user=user), + ) + + app = create_app() with app.app_context():