Skip to content

Email Delivery Implementation

Last verified: 2026-06-25.

This document records the EP6-T3 backend delivery implementation. It covers the shared email sender plumbing. Workflow-specific email calls are EP6-T5.

Runtime Behavior

NotificationService.scheduleMultiChannel(...) now handles NotificationChannel.EMAIL as a real delivery channel:

  • user notification preferences still decide whether EMAIL is scheduled;
  • the notification row is saved first;
  • the saved notification is rendered into an email message;
  • the configured sender submits it to Amazon SES;
  • provider success logs the notification id, user id, notification key, and SES message id;
  • provider failure is logged without full recipient email or message body and does not roll back unrelated workflow state.

If the recipient email is missing, the notification row remains saved and the email send is skipped.

Sender

Backend sender class:

  • SesEmailNotificationSender
  • provider: Amazon SES v2 async client
  • source address: MamNajem <no-reply@mamnajem.pl>
  • default region: eu-west-1
  • default credential source: runtime AWS SDK credential chain

No SMTP password or SES-specific static secret is required.

Config properties:

notification:
  email:
    enabled: ${NOTIFICATION_EMAIL_ENABLED:false}
    region: ${NOTIFICATION_EMAIL_REGION:${AWS_REGION:eu-west-1}}
    from-address: ${NOTIFICATION_EMAIL_FROM_ADDRESS:no-reply@mamnajem.pl}
    from-name: ${NOTIFICATION_EMAIL_FROM_NAME:MamNajem}
    app-url: ${NOTIFICATION_EMAIL_APP_URL:${APP_URL:https://mamnajem.pl}}
    test-recipient-override: ${NOTIFICATION_EMAIL_TEST_RECIPIENT_OVERRIDE:}

The integration Spring profile enables email by default:

notification:
  email:
    enabled: ${NOTIFICATION_EMAIL_ENABLED:true}
    app-url: ${NOTIFICATION_EMAIL_APP_URL:${APP_URL:https://web-integration.mamnajem.pl}}

Templates

EmailNotificationRenderer produces simple text email bodies for the launch notification keys and supports Polish and English subjects/body copy. Polish is the default/fallback for the Poland paid pilot.

Launch keys covered by the renderer include:

  • payment reminders and created payment requests;
  • overdue payment reminders;
  • tenant invitations;
  • payment proof and marked-paid updates;
  • handover confirmation requests;
  • final settlement confirmation requests;
  • generic notifications.

EP6-T4 owns final visual layout and copy polish. EP6-T5 wires the templates into launch workflows; see Email workflow wiring.

Verification

Local verification:

  • mvn -q -Djacoco.skip=true -Dtest=EmailNotificationRendererTest,NotificationServiceEmailDeliveryTest,SesEmailNotificationSenderTest test
  • mvn -q verify

GitLab verification:

  • backend pipeline 2628220111
  • commit 9147785
  • maven-test: success
  • maven-build-artifacts: success
  • api-backwards-compatibility-check: success
  • maven-deploy-integration-host: success

Post-deploy browser verification:

  • https://integration.mamnajem.pl/actuator/health
  • response: {"status":"UP","groups":["liveness","readiness"]}

Workflow-level email channel wiring is complete in EP6-T5 and documented in Email workflow wiring.