Preskoči na sadržaj

E15-F1: Transactional Email Service

Epic: E15: Notifications & Communications

Size: M (Medium)

Problem / Outcome

Send transactional emails for orders, quotas, etc.

Scope

In-Scope:

  • Email templates: order confirmation, quota invitation, ticket delivery
  • Delivery via Mailgun
  • Delivery status tracking

Out-of-Scope:

  • Marketing emails
  • Alternative email providers (SendGrid, SES)

Acceptance Criteria

  • AC1: Order confirmation email sent after payment
  • AC2: Quota invitation email sent on quota creation
  • AC3: Delivery status tracked (sent, delivered, failed)

Data Model Impact

EmailTemplate table:
- id (UUID, PK)
- template_key (VARCHAR, UNIQUE)
- subject (VARCHAR)
- body_html (TEXT)
- body_text (TEXT)
- variables (VARCHAR[])
- is_active (BOOLEAN)
- created_at (TIMESTAMP)
- updated_at (TIMESTAMP)

EmailLog table:
- id (UUID, PK)
- template_key (VARCHAR)
- recipient_email (VARCHAR)
- subject (VARCHAR)
- variables_json (JSONB)
- provider (ENUM: mailgun)
- provider_message_id (VARCHAR)
- status (ENUM: queued, sent, delivered, bounced, failed)
- sent_at (TIMESTAMP)
- delivered_at (TIMESTAMP)
- error_message (VARCHAR, nullable)

Email templates:
- order_confirmation
- quota_invitation
- ticket_delivery
- ticket_transfer_outgoing
- ticket_transfer_incoming
- refund_confirmation
- match_update_notification
- match_cancellation
- loyalty_points_awarded

Permissions/Roles

  • System

How to Verify

npm test -- --grep "email service"

Expected: Emails sent successfully.

Dependencies

  • None (external service)

Implementation Tasks

See E15: Notifications Tasks

Doc References


Last Updated: January 2026