feat(notifications): email REQUESTED recipients immediately (per-job opt-in) #22

Merged
KofTwentyTwo merged 1 commits from feature/notify-email-requested into develop 2026-10-14 23:51:06 +00:00
KofTwentyTwo commented 2026-10-14 03:14:29 +00:00 (Migrated from github.com)

Summary

This is the delivery half of the durable-jobs "Email me when done" opt-in (QRun-IO/qqq durable jobs spec, section 2.11: "Email is opt-in, either for each job or as a standing preference. It is delivered by qbit-alerts' email channel").

  • New EmailStatus.REQUESTED.
  • NotificationEmailer now also picks up REQUESTED recipients from the last day:
    • They are emailed immediately, with no category preference or minimum-severity check.
    • A recipient who also has an IMMEDIATE preference gets one email, not two.
    • A recipient with no known address is marked SKIPPED.
    • ALERT-category notifications are still never emailed here.
  • Recipients without REQUESTED behave as before.

Follow-up (needs QQQ RC.6)

Core's producer sets the NotificationSignal attribute emailRequested=true when a job has notifyEmail (QRun-IO/qqq#1178). RC.5's QAlerts path has no attributes; this repo uses the spi.NotificationSignal stand-in until RC.6. So mapping that attribute to REQUESTED on the recipient rows lands with the RC.6 core notify() adoption: one line in recipient creation.

Tests

NotificationEmailAndNoticesTest: 8 new cases covering requested with no preference, requested with IMMEDIATE (sent once), not requested (unchanged), requested with no address (SKIPPED), and ALERT category. ./mvnw -o verify: 82 tests green, JaCoCo 92.24% instructions and 100% classes.

🤖 Generated with Claude Code

## Summary This is the delivery half of the durable-jobs **"Email me when done"** opt-in (QRun-IO/qqq durable jobs spec, section 2.11: "Email is opt-in, either for each job or as a standing preference. It is delivered by qbit-alerts' email channel"). - New `EmailStatus.REQUESTED`. - `NotificationEmailer` now also picks up REQUESTED recipients from the last day: - They are emailed immediately, with no category preference or minimum-severity check. - A recipient who also has an IMMEDIATE preference gets one email, not two. - A recipient with no known address is marked SKIPPED. - `ALERT`-category notifications are still never emailed here. - Recipients without REQUESTED behave as before. ## Follow-up (needs QQQ RC.6) Core's producer sets the `NotificationSignal` attribute `emailRequested=true` when a job has `notifyEmail` (QRun-IO/qqq#1178). RC.5's QAlerts path has no attributes; this repo uses the `spi.NotificationSignal` stand-in until RC.6. So mapping that attribute to REQUESTED on the recipient rows lands with the RC.6 core `notify()` adoption: one line in recipient creation. ## Tests `NotificationEmailAndNoticesTest`: 8 new cases covering requested with no preference, requested with IMMEDIATE (sent once), not requested (unchanged), requested with no address (SKIPPED), and ALERT category. `./mvnw -o verify`: 82 tests green, JaCoCo 92.24% instructions and 100% classes. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
KofTwentyTwo commented 2026-10-14 23:48:48 +00:00 (Migrated from github.com)

Superseded by #37 (merged with current develop, conflicts resolved, REQUESTED email now honours preferences, pause and quiet hours). Left open for the coordinator to close.

Superseded by #37 (merged with current develop, conflicts resolved, REQUESTED email now honours preferences, pause and quiet hours). Left open for the coordinator to close.
Sign in to join this conversation.