Skip to content

Email Communications (Backend, SES) Part 2 - don't start until Part 1 complete. #95

@thaninbew

Description

@thaninbew

Summary

Connect the newly built Frontend Email Comms UI to the backend emails module and user data. This involves two workflows: 1) Updating the automated transactional HTML template used for "Donation Response" (sent immediately after a successful donation), and 2) Fetching target lists and dispatching bulk campaigns via Amazon SES for "Relapsed Donor Message" and "Email Subscribers" (mass email lists).

To reiterate:
Relapsed Donor Message: Email sent to lapsed donors.
Donation Response: Email to be sent right after a donation is made to the donor.
Email Subscribers: People in email list.

Steps

  1. Wire the "Relapsed Donor Message" tab to fetch targets using the existing GET /donations/lapsed endpoint in apps/backend/src/donations/donations.controller.ts.
  2. Implement backend logic to fetch the full list of opted-in users for the "Email Subscribers" tab.
  3. Create logic to save the "Donation Response" editor payload as an automated transactional HTML template, to be triggered via SES directly whenever a donation is successfully processed in the system.
  4. Create a POST endpoint in the emails module that accepts the HTML body string, subject line, and the target group to dispatch the bulk campaigns ("Relapsed Donors" and "Email Subscribers").
  5. Connect the new POST endpoint to the existing Amazon SES integration to dispatch the emails.
  6. Replace the mocked "Save Changes" / "Send" action on the frontend with the actual API calls to either update the template (Donation Response) or trigger the bulk send (Relapsed/Subscribers).

Acceptance Criteria

  • The backend can successfully receive and store the customized HTML template for the automatic "Donation Response".
  • The system automatically sends the tailored "Donation Response" template to a user immediately after they make a donation.
  • The backend can receive a compiled HTML string, subject line, and target group, and trigger a mass email send via Amazon SES.
  • The "Relapsed Donor Message" tab successfully identifies and targets lapsed donors using the existing /donations/lapsed logic.
  • The "Email Subscribers" tab accurately pulls the recipient list of all subscribed users to be mailed.
  • Clicking "Save Changes" / "Send" on the frontend successfully handles either the bulk email target or updating the donation template.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions