Enhance newsletter functionality with contact email support
- Added support for a contact email in newsletter generation, allowing users to specify a reply-to address. - Updated the SMTP settings to include a reply-to field in the configuration. - Modified the newsletter templates to display the contact email in plain text and HTML formats. - Improved the dashboard UI to allow users to set the reply-to address when configuring SMTP settings.
This commit is contained in:
@@ -18,6 +18,7 @@ def get_smtp_settings(db: Session) -> dict[str, str]:
|
||||
"username": get_config(db, "smtp.username", ""),
|
||||
"password": get_config(db, "smtp.password", ""),
|
||||
"from_email": get_config(db, "smtp.from_email", ""),
|
||||
"reply_to": get_config(db, "smtp.reply_to", ""),
|
||||
"use_tls": get_config(db, "smtp.use_tls", "true"),
|
||||
"recipients": get_config(db, "smtp.recipients", ""),
|
||||
# Zeitplan
|
||||
@@ -91,6 +92,8 @@ def send_newsletter(
|
||||
msg["Subject"] = subject
|
||||
msg["From"] = settings["from_email"]
|
||||
msg["To"] = ", ".join(recipients)
|
||||
if settings.get("reply_to"):
|
||||
msg["Reply-To"] = settings["reply_to"]
|
||||
|
||||
try:
|
||||
port = int(settings["port"])
|
||||
|
||||
Reference in New Issue
Block a user