Update configuration and enhance newsletter generation features
- Change WIKI_API_URL in .env.example and config to point to the new API endpoint. - Set COOKIE_SECURE to false for local development in .env.example and config. - Improve the newsletter generation logic to handle new and edited articles separately. - Add display options for showing date, user, and category in the newsletter output. - Enhance error handling for Wiki API requests and update templates for better user feedback. - Update CSS for new UI elements and improve overall layout in dashboard and login pages.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import smtplib
|
||||
from datetime import datetime
|
||||
from email.mime.multipart import MIMEMultipart
|
||||
from email.mime.text import MIMEText
|
||||
from typing import Sequence
|
||||
|
||||
@@ -40,7 +41,9 @@ def send_newsletter(
|
||||
_log(db, subject, recipients, "failed", "SMTP unvollständig konfiguriert.", scheduled)
|
||||
return
|
||||
|
||||
msg = MIMEText(html_content, "html", "utf-8")
|
||||
msg = MIMEMultipart("alternative")
|
||||
msg.attach(MIMEText(text_content, "plain", "utf-8"))
|
||||
msg.attach(MIMEText(html_content, "html", "utf-8"))
|
||||
msg["Subject"] = subject
|
||||
msg["From"] = settings["from_email"]
|
||||
msg["To"] = ", ".join(recipients)
|
||||
|
||||
Reference in New Issue
Block a user