forked from rDrama/rDrama
1
0
Fork 0

add a 2nd email account for WPD

master
Aevann1 2022-08-05 19:22:17 +02:00
parent 2ec5531080
commit a75d481f60
3 changed files with 10 additions and 4 deletions

View File

@ -16,6 +16,7 @@ import time
from sys import stdout, argv
import faulthandler
import json
import random
app = Flask(__name__, template_folder='templates')
app.url_map.strict_slashes = False
@ -43,8 +44,13 @@ app.config["CACHE_REDIS_URL"] = environ.get("REDIS_URL", "redis://localhost")
app.config['MAIL_SERVER'] = 'smtp.gmail.com'
app.config['MAIL_PORT'] = 587
app.config['MAIL_USE_TLS'] = True
app.config['MAIL_USERNAME'] = environ.get("MAIL_USERNAME", "").strip()
app.config['MAIL_PASSWORD'] = environ.get("MAIL_PASSWORD", "").strip()
if environ.get("MAIL_USERNAME2") and random.random() < 0.5:
app.config['MAIL_USERNAME'] = environ.get("MAIL_USERNAME2", "").strip()
app.config['MAIL_PASSWORD'] = environ.get("MAIL_PASSWORD2", "").strip()
else:
app.config['MAIL_USERNAME'] = environ.get("MAIL_USERNAME", "").strip()
app.config['MAIL_PASSWORD'] = environ.get("MAIL_PASSWORD", "").strip()
app.config['SETTINGS'] = {}

View File

@ -14,7 +14,7 @@ from flask_mail import Message
def send_mail(to_address, subject, html):
msg = Message(html=html, subject=subject, sender=f"{SITE_NAME}@{SITE}", recipients=[to_address])
msg = Message(html=html, subject=subject, sender=app.config['MAIL_USERNAME'], recipients=[to_address])
mail.send(msg)

View File

@ -18,7 +18,7 @@
<p class="text-small text-muted">Change the email address used to sign in to your account.</p>
<div class="settings-section rounded">
<form action="/settings/security" method="post">
<form action="/settings/security" method="post">
<input type="hidden" name="formkey" value="{{v.formkey}}">
<div class="body">
<div class="d-lg-flex">