Add confirmation email add to config

This commit is contained in:
pstruebi
2022-06-15 10:45:23 +02:00
parent bc4ea9fdb0
commit 7278054e95
3 changed files with 6 additions and 10 deletions

View File

@@ -48,7 +48,10 @@ def register():
logging.info("Generated confirmation url: %s", confirm_url)
content = render_template('auth/confirm_mail.html', confirm_url=confirm_url, username=username, email=email)
subject = "Registrierung für ProPedal - Planner von %s" % email
calendar_interface.send_mail("struebin.patrick@gmail.com", subject, content)
# Send confirmation email to a defined static confirmation add, if not defined use the users add
confirmation_add = current_app.config.get("CONFIRMATATION_EMAIL_ADD", email)
calendar_interface.send_mail(confirmation_add, subject, content)
flash("Registrierung erfolgreich.")
return redirect(url_for("index"))

View File

@@ -113,7 +113,6 @@ def get_calendar_event(id, filter: str=""):
return execute_user_request(token, f"calendars/{MsalConfig.CALENDAR_ID}/events/{id}{filter}")
def get_future_calendar_events():
t1=datetime.now()

View File

@@ -3,16 +3,10 @@ class DefaultConfig:
TESTING = False
DATABASE_URI = "users.db"
SECRET_KEY = SECURITY_PASSWORD_SALT='default'
CONFIRMATATION_EMAIL_ADD=None
class Config(DefaultConfig):
AUTHORITY = "https://login.microsoftonline.com/propedal.at",
CLIENT_ID = "52f192c4-875d-44a2-b28a-575e920225e5", # client public id (from azure web interface)#"da3fc28c-5fcf-4884-9477-903a4420cc3d",
scope = ["https://graph.microsoft.com/.default"], # scopes from api
secret = "irj8Q~PliZzSe7JnXEaiWKQ6v0CAg1DTZOO~Ccsf" # api secret key (from azure web interface)#"bqP8Q~SEp_AmYYDZoEykXxZdADoCOhzOOhbO3c3T"
USER_ID = "simone.profus@propedal.at"
CALENDAR_ID = "AAMkADY0MDg1MTVjLTg5ZjItNGQxYS04MGQ3LWY2NjJmYjM0YmZhOQBGAAAAAADXD7SdVoWYQI4RYXbBumMEBwAf_ngZxs71RonY3GuLL8TVAAAAAAEGAAAf_ngZxs71RonY3GuLL8TVAADHFxN2AAA=" # calendar id - determined by /users/id/calendars
CONFIRMATATION_EMAIL_ADD= "struebin.patrick@gmail.com"
class ProductionConfig(Config):
SECRET_KEY = '\xacI4\x077\x16?Q\xb4")\xdb\x066\x95\x11i\x0b\x0c&\xb6rP\''