feat(email): the report, invites, resets and test sends go through the outbox; only it talks SMTP (#5508)
#5508 "Every other email through the outbox: weekly report, invites, password resets, and the test buttons" (milestone 501). - outbox.send_each queues one email per reader (claimed, so the sender doesn't take it too) and tries them at once, for a page that answers with what happened; outbox.said words the result. attempt takes a cfg for a test of the form's unsaved settings and returns the settled rows. - Weekly report (scheduled and Send now) and invites: queued, tried at once; one the server couldn't take yet is retried for an hour. An invite that didn't go shows its link with the reason, as before. - Password reset: queued in the reset link's own transaction; the sender delivers it on its next tick. - Settings -> Notifications test email and a rule's Send test: queued and recorded with retry=False, tried once (System 156 ruling). - Removed mail.send, notifications._send_email and _smtp_send_sync; dispatch_notifications is webhook only. A guard asserts only the outbox (and smtp_open itself) opens an SMTP connection, with a self-test. Also fixes run 8941 (#5507's integration test): its Also-send-to addresses were "@test", which is_real_address rightly drops; they are example.com now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -522,7 +522,7 @@ async def _dispatch_notification(
|
||||
await outbox.hold_alert(app, alert_data, event_id)
|
||||
except Exception:
|
||||
logger.exception("Alert %s: its email could not be queued", event_id)
|
||||
results = await dispatch_notifications({}, app.config.get("WEBHOOK", {}), alert_data)
|
||||
results = await dispatch_notifications(app.config.get("WEBHOOK", {}), alert_data)
|
||||
|
||||
webhook_r = results.get("webhook")
|
||||
if not webhook_r:
|
||||
|
||||
Reference in New Issue
Block a user