megaphone is live
This commit is contained in:
parent
c52e35b9c8
commit
51d2c6e7a2
@ -29,15 +29,18 @@ def index():
|
|||||||
if request.form['action'] == "megaphone":
|
if request.form['action'] == "megaphone":
|
||||||
emails_list = get_model().all_accounts_with_active_vms()
|
emails_list = get_model().all_accounts_with_active_vms()
|
||||||
current_app.logger.info(f"sending '{request.form['subject']}' email to {len(emails_list)} users...")
|
current_app.logger.info(f"sending '{request.form['subject']}' email to {len(emails_list)} users...")
|
||||||
for email in emails_list:
|
# for email in emails_list:
|
||||||
current_app.logger.info(email)
|
# 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(
|
current_app.config["FLASK_MAIL_INSTANCE"].send(
|
||||||
Message(
|
Message(
|
||||||
request.form['subject'],
|
request.form['subject'],
|
||||||
sender=current_app.config["MAIL_DEFAULT_SENDER"],
|
sender=current_app.config["MAIL_DEFAULT_SENDER"],
|
||||||
body=request.form['body'],
|
body=f"{request.form['body']}\n\n{suffix1}\n{suffix2}",
|
||||||
bcc=["forest.n.johnson@gmail.com", "forest@sequentialread.com"]
|
bcc=emails_list,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
current_app.logger.info(f"sending email is done.")
|
current_app.logger.info(f"sending email is done.")
|
||||||
|
Loading…
Reference in New Issue
Block a user