# Requirements Clarification Questions - identity-email-notifications Context: the CMS has no mail at all today. Invitations work through a link that an administrator copies and passes on. Bryan chose real e-mail. SimpleDeckApp already sends mail (MailKit, `IEmailSender`, options section `Email`, sender `no-reply@slpsoftware.nl`); the plan is to follow that pattern, preferably as a shared abstraction in Core. Nothing is built until these are answered. Answers are relayed by session "CMS & API". ## Question 1: SMTP server / provider Which mail server should the CMS send through (test and, later, production)? - A) The same SMTP server SimpleDeckApp uses in production (reuse host, account type and domain pattern) - B) The SMTP server of the hosting partner (own account/mailbox) - C) A transactional mail service (for example Brevo, Mailgun, Postmark, Amazon SES) with its own account - D) Own mail server on the Pi (Postfix and similar) - X) Other (please describe after [Answer]: tag below) [Answer]: A (same SMTP as SimpleDeckApp). Local dev tool: smtp4dev (already installed at Bryan). ## Question 2: Sender address and domain From which address should the mails come? - A) One shared sender for all sites (for example no-reply@slpsoftware.nl), per-site name only in the display name - B) A sender per site on that site's own domain (for example no-reply@andreaslop.nl for Andrea's site) - C) A shared address for the test environment and a per-site address for production - X) Other (please describe after [Answer]: tag below) [Answer]: X - the sender address must be settable PER WEBSITE IN THE SITE SETTINGS (not config only). Scope extension: see requirements.md section 6, proposal P1 (needs approval before it is built). ## Question 3: Sender authentication (SPF / DKIM / DMARC) Is the chosen sender domain already set up so that mail is not marked as spam? - A) Yes, SPF, DKIM and DMARC are already set up for the sender domain (reuse the SimpleDeckApp setup) - B) Not sure; please check (read-only) what is published and report - C) No; it still has to be set up before production (test may go out without it) - X) Other (please describe after [Answer]: tag below) [Answer]: A (Bryan: SPF/DKIM/DMARC already set up). Read-only DNS check done by the AI, see requirements.md section 7. ## Question 4: Which mails Which mails should the CMS send in the first version? (Select the lowest letter that covers what you want; each option includes the previous ones.) - A) Only the invitation mail (link to complete the account), plus a "new invitation link" mail when an administrator regenerates one - B) A, plus password reset ("forgot password") with a mail link - C) B, plus a notification when the account is deactivated or the role changes - X) Other (please describe after [Answer]: tag below) [Answer]: C (invitation + new link + password reset + notification on deactivation / role change). Password reset is a new flow: see requirements.md section 6, proposal P2. ## Question 5: Per-site mail content How much should the mail look like each site? - A) Per site: sender name and mail text in Dutch, plain and without a logo - B) Per site: sender name, Dutch text, and the site's logo and brand colour in a shared template - C) Fully custom template per site (separate HTML per site) - X) Other (please describe after [Answer]: tag below) [Answer]: B (logo + brand colour in a shared template; reuse the BrandLogo/getBrand idea). ## Question 6: Languages In which language(s) should the mails be written? - A) Dutch only (the admin of these sites is Dutch) - B) Dutch and English, following the recipient's or the site's default language - X) Other (please describe after [Answer]: tag below) [Answer]: B (Dutch and English, following site default language or the recipient). How the language is chosen: requirements.md section 6, proposal P3. ## Question 7: When sending fails What should happen when the mail cannot be sent (server down, wrong credentials)? - A) The invitation is still created and the administrator sees a clear message plus the copyable link (the current link stays available as fallback) - B) The invitation is not created and the administrator sees an error - C) The mail is retried in the background a few times; the administrator sees the status ("sent", "failed") and the copyable link - X) Other (please describe after [Answer]: tag below) [Answer]: A + an option in the admin to RESEND the mail (after a failure and optionally by hand); the copyable link is always available. ## Question 8: Where the mail is sent from (sending model) How should the sending be done technically? - A) Directly during the request (simple; the request waits for the mail server) - B) In the background (queue in the database or in memory), the request returns immediately - X) Other (please describe after [Answer]: tag below) [Answer]: A (directly during the request). ## Question 9: Secrets on the host How do the SMTP credentials get onto the Pi? - A) As environment variables in the host's `shared/env` (mode 600), same as other secrets (Email__Smtp__Username, Email__Smtp__Password) - B) Via another secrets mechanism (please describe) - X) Other (please describe after [Answer]: tag below) [Answer]: A (Email__Smtp__Username/Password in shared/env, mode 600). ## Question 10: Abuse and cost protection How should the CMS prevent being used to spam or run up costs? - A) A rate limit per administrator and per recipient address (for example a few mails per address per hour) plus the existing login rate limits - B) Only the existing role checks (only Owner/Administrator can trigger mails), no extra limit - X) Other (please describe after [Answer]: tag below) [Answer]: B (role check only, no extra rate limit). Caveat: the anonymous password-reset request keeps the existing limiters; risk assessment in requirements.md section 6, proposal P4. ## Question 11: Link in the mail The link in the mail points to the admin on the site's own address. Where does the CMS get that address from? - A) A configured setting per site (for example `App:PublicBaseUrl`), validated at start-up - B) From the incoming request (Host header, behind the proxy) - X) Other (please describe after [Answer]: tag below) [Answer]: A (App:PublicBaseUrl or similar per site, validated at start-up). ## Question 12: Shared code How should the mail code be shared between SlpModularCms and SimpleDeckApp? - A) A new `IEmailSender` in SlpModularCms.Core, following the SimpleDeckApp pattern (same interface and options names); no code shared across the two repos - B) A small shared NuGet package used by both repos - X) Other (please describe after [Answer]: tag below) [Answer]: A (IEmailSender + EmailOptions in Core, same shape as SimpleDeckApp, no shared code). ## Question 13: Testing without real sending How do we test? - A) A fake sender in unit and integration tests (always), plus a local catcher (smtp4dev/Papercut) for manual runs; one manual test mail to a real address on the test host before approval - B) Fake sender only, no real test mail - X) Other (please describe after [Answer]: tag below) [Answer]: A with smtp4dev + one real test mail to an address of Bryan on the test host before approval. ## Question 14: Scope across sites For which sites should this be switched on? - A) All sites on the shared code, switched on per site by configuration (no mail configured = the current copy-link flow keeps working unchanged) - B) First only ASF test; SlpSoftware later - X) Other (please describe after [Answer]: tag below) [Answer]: A (all sites, on by configuration; no mail configured = current copy-link flow unchanged). ## Question 15: Security Extensions Should security extension rules be enforced for this feature? - A) Yes - enforce all SECURITY rules as blocking constraints (recommended; this feature handles credentials, links that grant account access, and personal data) - B) No - skip all SECURITY rules - X) Other (please describe after [Answer]: tag below) [Answer]: A (Security extension on). ## Question 16: Property-Based Testing Extension Should property-based testing (PBT) rules be enforced for this feature? - A) Yes - enforce all PBT rules as blocking constraints - B) Partial - only for pure functions and serialization round-trips (for example building links and templates) - C) No - skip all PBT rules - X) Other (please describe after [Answer]: tag below) [Answer]: B (PBT partial). ## Question 17: Operations Phase Should this feature go through the Operations phase after Construction (setting up deployment and monitoring)? - A) Yes - run the Operations phase after Construction (deployment + monitoring setup) - B) No - stop after Build and Test (deployment/monitoring are out of scope for this feature) - C) Not sure yet - ask me again after the Construction phase - X) Other (please describe after [Answer]: tag below) [Answer]: A (Operations phase yes).