add send_pgp_newsletter() to shell
This commit is contained in:
parent
0acde29443
commit
2261cd2138
15
shell.py
15
shell.py
|
@ -55,6 +55,21 @@ def send_mailbox_newsletter():
|
|||
LOG.warning("Cannot send to user %s", user)
|
||||
|
||||
|
||||
def send_pgp_newsletter():
|
||||
for user in User.query.order_by(User.id).all():
|
||||
if user.notification and user.activated:
|
||||
try:
|
||||
LOG.d("Send PGP newsletter to %s", user)
|
||||
send_email(
|
||||
user.email,
|
||||
"Introducing PGP - encrypt your emails so only you can read them",
|
||||
render("com/newsletter/pgp.txt", user=user),
|
||||
render("com/newsletter/pgp.html", user=user),
|
||||
)
|
||||
except Exception:
|
||||
LOG.warning("Cannot send to user %s", user)
|
||||
|
||||
|
||||
app = create_app()
|
||||
|
||||
with app.app_context():
|
||||
|
|
Loading…
Reference in New Issue