Add 'from_name' field to SMTP settings and update email sending logic
- Introduced a new 'from_name' field in the SMTP settings to allow users to specify a sender name. - Updated the dashboard template to include an input for the sender name. - Modified the email sending logic to format the 'From' header with the sender name if provided, enhancing email presentation.
This commit is contained in:
@@ -482,6 +482,7 @@ def update_smtp_settings(
|
||||
username: str = Form(""),
|
||||
password: str = Form(""),
|
||||
from_email: str = Form(""),
|
||||
from_name: str = Form(""),
|
||||
reply_to: str = Form(""),
|
||||
use_tls: str | None = Form(None),
|
||||
recipients: str = Form(""),
|
||||
@@ -504,6 +505,7 @@ def update_smtp_settings(
|
||||
set_config(db, "smtp.username", username.strip())
|
||||
set_config(db, "smtp.password", password)
|
||||
set_config(db, "smtp.from_email", from_email.strip())
|
||||
set_config(db, "smtp.from_name", from_name.strip())
|
||||
set_config(db, "smtp.reply_to", reply_to.strip())
|
||||
set_config(db, "smtp.use_tls", "true" if use_tls == "true" else "false")
|
||||
set_config(db, "smtp.recipients", recipients.strip())
|
||||
|
||||
Reference in New Issue
Block a user