Skip to content

[Help Wanted] Build alert delivery worker (email + webhook) #10

@Oshgig

Description

@Oshgig

Overview

Alerts are stored in SQLite but never delivered. NGOs never receive notifications. We need a lightweight background worker to attempt delivery.

Scope

  • Read unacknowledged alerts from the alerts table
  • Attempt email delivery via SMTP (configurable in .env)
  • Attempt webhook delivery via HTTP POST to organization.webhook_url
  • Update delivery status in DB (delivered, failed, pending)
  • Expose retry logic (max 3 attempts with exponential backoff)
  • Add endpoint GET /api/organizations/{org_id}/alerts/pending for monitoring

Acceptance Criteria

  • When an alert is created, the worker attempts delivery within 60 seconds
  • Failed deliveries are retried up to 3 times
  • Delivery status is queryable via API
  • Worker runs as FastAPI BackgroundTasks (no external queue needed for MVP)

Resources

Difficulty: Intermediate
Labels: help wanted, backend, api

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions