mirror of
https://git.hiabuto.net/C3MA/CCMA.git
synced 2026-09-06 03:20:49 +02:00
Add configurable e-mail delivery: direct SMTP send or IMAP drafts
Mahnungs- and SEPA-info-mails could previously only be saved as a local .eml file that still had to be manually imported into Thunderbird. Add a per-store "E-Mail-Versand" configuration (Optionen -> E-Mail-Versand, stored in repository.json alongside the rest of the club's settings, since different stores may use different mailboxes) with four delivery modes: - "Lokal speichern": today's behaviour, unchanged default for existing stores. - "Direkt versenden": sends via SMTP. - "Als Entwurf ablegen": IMAP APPENDs into a configurable drafts folder, so it shows up live in whatever mail client is already watching that account. - "Jedes Mal fragen": prompts once per generation action (not per e-mail -- a SEPA batch can cover dozens of members) with Senden/Entwürfe/Abbrechen. New ccma.services.mail_delivery module (smtplib/imaplib, no new dependency) opens one authenticated connection per batch and reuses it across all messages instead of reconnecting per recipient. Both "Verbindung testen" buttons in Options exercise the same connection path used for real delivery. The archived per-member copy of every generated e-mail is unaffected and still always written regardless of delivery mode. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
b7554478ac
commit
6b0da82b45
@@ -30,6 +30,19 @@ REMINDER_CHANNEL_LABELS = {
|
||||
"personal": "Persönlich",
|
||||
}
|
||||
|
||||
EMAIL_DELIVERY_MODE_LABELS = {
|
||||
"local": "Lokal speichern (bisheriges Verhalten)",
|
||||
"send": "Direkt versenden",
|
||||
"drafts": "Als Entwurf im Postfach ablegen",
|
||||
"ask": "Jedes Mal fragen",
|
||||
}
|
||||
|
||||
EMAIL_SECURITY_LABELS = {
|
||||
"starttls": "STARTTLS",
|
||||
"ssl": "SSL/TLS",
|
||||
"none": "Keine",
|
||||
}
|
||||
|
||||
|
||||
def display_label(labels: Mapping[str, str], key: str) -> str:
|
||||
return labels.get(key, key)
|
||||
|
||||
Reference in New Issue
Block a user