Add mail attachment settings with cache config, TTL, and URL-based attachment mapping

This commit is contained in:
Roman 2025-10-07 19:49:12 +02:00 committed by Oliver Zander
parent f98894b250
commit 319a06833e
1 changed files with 30 additions and 0 deletions

View File

@ -165,3 +165,33 @@ NUTZUNGSBEDINGUNGEN_MAILINGLISTEN = 'static/input/nutzungsbedingungen-mailinglis
NUTZUNGSBEDINGUNGEN_LITERATURSTIPENDIUM = 'static/input/nutzungsbedingungen-literaturstipendium.pdf'
NUTZUNGSBEDINGUNGEN_OTRS = 'static/input/2025_Nutzungsvereinbarung_OTRS.docx.pdf'
NUTZUNGSBEDINGUNGEN_VISITENKARTEN = 'static/input/nutzungsbedingungen-visitenkarten.pdf'
# Directory where downloaded attachments will be cached
MAIL_ATTACHMENT_CACHE_DIR = BASE_DIR / 'var' / 'mail_attachments'
# Cache TTL (default: 1 day)
MAIL_ATTACHMENT_TTL_SECONDS = 24 * 60 * 60
# File attachments via URL:
# - "applicant": attachments for emails sent to applicants
# - "staff": attachments for emails sent to the team (community@wikimedia.de)
#
# Top-level keys: "applicant" / "staff"
# Second-level keys: service code ("choice") or "ALL" for global attachments
# that should be included in all emails of this type.
MAIL_ATTACHMENT_URLS = {
'applicant': {
# Global attachments for all applicant emails
'ALL': [],
# Special attachments for specific services:
'VIS': [('https://foerderung.wikimedia.de/static/input/nutzungsbedingungen-visitenkarten.pdf', 'Nutzungsbedingungen-Visitenkarten.pdf')], # Business cards
'MAIL': [('https://foerderung.wikimedia.de/static/input/nutzungsbedingungen-mail.pdf', 'Nutzungsbedingungen-Mail.pdf')], # Emails
'LIST': [('https://foerderung.wikimedia.de/static/input/nutzungsbedingungen-mailinglisten.pdf', 'Nutzungsbedingungen-Mailinglisten.pdf')], # Mailing lists
'LIT': [('https://foerderung.wikimedia.de/static/input/nutzungsbedingungen-literaturstipendium.pdf', 'Nutzungsbedingungen-Literaturstipendium.pdf')], # Literature grants
},
'staff': {
# Global attachments for all staff emails
'ALL': [],
# Example: 'IFG': ['https://example.com/internal-guideline.pdf']
},
}