WIP: sending method as an explicit choice, kept in payload-kv (superseded: the choice moves to a stored field)

Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-11-26 22:30:03 +01:00
co-authored by Claude Fable 5.2
parent 68a2555277
commit c6841a1674
34 changed files with 740 additions and 96 deletions
+21
View File
@@ -53,6 +53,27 @@ export const mailRules: DoctorRule[] = [
group: 'mail',
source: 'deep',
},
{
// "Sending method": what is chosen is what is used. A choice that cannot be used sends nothing.
id: 'mail-method',
check: (ctx) => {
const mail = ctx.deep?.mail
if (!mail) {return []}
if (mail.methodProblem === 'smtp-incomplete') {
return [{ fix: 'Site integrations → E-mail sending: fill in server, user name and password — or choose another sending method', message: '"Own SMTP server" is the chosen sending method, but its settings are incomplete: e-mails are not sent (nothing is sent another way)', severity: 'error' }]
}
if (mail.methodProblem === 'graph-not-set-up') {
return [{ fix: 'set the four GRAPH_* variables on the server — or choose another sending method in Site integrations → E-mail sending (Microsoft Graph is deprecated and removed in 2.0)', message: '"Microsoft Graph" is the chosen sending method, but the GRAPH_* variables are missing on this server: e-mails are not sent (nothing is sent another way)', severity: 'error' }]
}
if (mail.methodChosen === false && mail.transport !== 'none') {
return [{ fix: 'open Site integrations → E-mail sending, check "Sending method" and save: from then on the site sends that way only', message: `nobody has chosen the sending method yet: the site picks one from what is filled in (now: ${mail.transport === 'relay' ? 'the built-in service' : mail.transport === 'smtp' ? 'the SMTP server' : 'Microsoft Graph'}), and would switch by itself if that changed`, severity: 'info' }]
}
return []
},
docs: 'docs/email.md',
group: 'mail',
source: 'deep',
},
{
// Which signal makes the site a non-public copy for the mail service — said plainly, because that signal
// decides whether a copy of another site's data mails real people.