megaphone is live

This commit is contained in:
forest 2021-12-09 11:44:30 -06:00
parent c52e35b9c8
commit 51d2c6e7a2

View File

@ -29,15 +29,18 @@ def index():
if request.form['action'] == "megaphone":
emails_list = get_model().all_accounts_with_active_vms()
current_app.logger.info(f"sending '{request.form['subject']}' email to {len(emails_list)} users...")
for email in emails_list:
current_app.logger.info(email)
# for email in emails_list:
# current_app.logger.info(email)
suffix1 = "This email was sent by the Capsul Admin Megaphone."
suffix2 = "If you have any questions DO NOT REPLY TO THIS EMAIL, direct your inquiry to support@cyberia.club"
current_app.config["FLASK_MAIL_INSTANCE"].send(
Message(
request.form['subject'],
sender=current_app.config["MAIL_DEFAULT_SENDER"],
body=request.form['body'],
bcc=["forest.n.johnson@gmail.com", "forest@sequentialread.com"]
body=f"{request.form['body']}\n\n{suffix1}\n{suffix2}",
bcc=emails_list,
)
)
current_app.logger.info(f"sending email is done.")