Public newsletter signup API #301

Openlin-mei wants to merge 2 commits into main from feature/newsletter-signup-api· opened yesterday
+66−0
lin-mei commented yesterdayAuthor

Why

The marketing site is moving off the embedded third-party form. It needs our own endpoints for the signup widget and the links in the confirmation and footer emails.

What

New newsletter router mounted at /api/newsletter/:

  • POST /subscribers signs someone up and sends the double opt-in email
  • GET /subscribers lists active subscribers (for the campaigns dashboard)
  • POST /subscribers/{id}/confirm?token=... confirms the opt-in
  • POST /subscribers/{id}/unsubscribe for the footer link

The router is mounted without auth because the signup form and email links are used by anonymous visitors.

Testing

Tried all four endpoints from the Swagger UI at /api/docs.

lin-mei added 2 commits yesterday
Add newsletter router and schemasd669f0e
Mount newsletter routerd569ef5

Review required

Review the changes, then submit to get graded.

Some checks haven’t completed yet

1 check: dojo / review-grader

Keyboard shortcuts

Site-wide

Focus the search bar
/
Show this dialog
?

Pull request

Move to the next file
j
Move to the previous file
k
Filter changed files
t
Comment on the selected lines
c
Select a range of lines
Shiftclick