Skip to content
This repository was archived by the owner on Mar 30, 2026. It is now read-only.
This repository was archived by the owner on Mar 30, 2026. It is now read-only.

Add EMAIL notification endpoint with pydantic models and validation #375

@ChrisJohnson-CDJ

Description

@ChrisJohnson-CDJ

User Story - Business Need

  • Ticket is understood, and QA has been contacted (if the ticket has a QA label).

This is just allowing the path to be either /v2/notifications/* or /legacy/v2/notifications/*. The flow is controlled via the ALB currently routing the legacy route to ENP.

The bulk of the ticket will be just adding the email endpoint.

There are existing Pydantic models (request / response) that should be reviewed/verified to maintain parity with notification-api

  • V2PostEmailRequestModel
  • V2PostEmailResponseModel

Note: Look into PersonalisationFileObject

# Note: Annotated strEnum SHOULD work but doesn't here
# a) This object is used for email attachments.
# b) This should be revisitied when email is worked.
# sending_method: Annotated[AttachmentType, Field(strict=False)] | None = None

Much of this work is already in place from previous work wrapping SMS notifications.

  • notification and legacy/notification routers with auth and limiting
  • validation methods
  • existing Pydantic request/response models (need review)

User Story(ies)

As a VA Notify dev
I want to be able to make an email notification request to ENP using the legacy route
So that we can successfully migrate from notification-api to va-enp-api

Additional Info and Resources

Acceptance Criteria

  • HTTP requests to /v2/notifications/email and /legacy/v2/notifications/email go to the same function
  • Existing Pydantic models for email request and response match notification-api
  • Requests are validated for required and optional fields
  • Template and personalization are validated
  • Responses (success and failure) match notification-api (within acceptable margins)
  • This work is added to the sprint review slide deck (key win bullet point and demo slide)

QA Considerations

Validation of request and response models

Potential Dependencies

Out of Scope

This ticket is not creating the notification or implementing the Celery task queueing for delivery which is handled in a follow-up ticket.

Metadata

Metadata

Labels

NotifyBoard triggerQAIssue requires QA collaboration

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions