mirror of
https://github.com/simple-login/app.git
synced 2025-10-09 06:50:45 +08:00
add send_safari_extension_newsletter() to shell
This commit is contained in:
parent
e86c0655dd
commit
0bea79dc86
1 changed files with 11 additions and 2 deletions
13
shell.py
13
shell.py
|
@ -3,10 +3,9 @@ from IPython import embed
|
||||||
from sqlalchemy_utils import create_database, database_exists, drop_database
|
from sqlalchemy_utils import create_database, database_exists, drop_database
|
||||||
|
|
||||||
from app.config import DB_URI
|
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 app.models import *
|
||||||
from server import create_app
|
from server import create_app
|
||||||
from app import email_utils
|
|
||||||
|
|
||||||
|
|
||||||
def create_db():
|
def create_db():
|
||||||
|
@ -31,6 +30,16 @@ def reset_db():
|
||||||
create_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()
|
app = create_app()
|
||||||
|
|
||||||
with app.app_context():
|
with app.app_context():
|
||||||
|
|
Loading…
Add table
Reference in a new issue