Skip to content

PDJB-1260: Send registration confirmation email for organisation landlords - #1664

Open
Bill-Haigh wants to merge 4 commits into
mainfrom
feat/PDJB-1260-org-landlord-registration-confirmation-email
Open

PDJB-1260: Send registration confirmation email for organisation landlords#1664
Bill-Haigh wants to merge 4 commits into
mainfrom
feat/PDJB-1260-org-landlord-registration-confirmation-email

Conversation

@Bill-Haigh

@Bill-Haigh Bill-Haigh commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Ticket number

PDJB-1260

Goal of change

Organisation landlords received no confirmation email on completing registration.

Description of main change(s)

  • Sends a confirmation email when an organisation landlord completes registration, with organisation-specific copy ("You have registered [organisation name] as a landlord")
  • Adds the ORGANISATIONAL_LANDLORD_REGISTRATION_CONFIRMATION_EMAIL template, including its Notify template IDs
  • Narrows the existing individual-landlord email helper to take an IndividualLandlord, removing its runtime type check
  • Extends the organisation journey integration test to submit check your answers and assert the email is sent

Anything you'd like to highlight to the reviewer?

  • The email goes to the registrant's email address. This branch is rebased onto PDJB-1282, which added the registrant email step and made OrgLandlordRegistrationCyaStepConfig populate organisationRegistrantEmail for real. The second commit switches the recipient from the organisation address to the registrant's and removes the // TODO: PDJB-1282 that was tracking it. The integration test submits a registrant email that differs from the organisation email, so the assertion proves which one is used.
  • Submitting check your answers still renders an error page for org landlords. RegisterLandlordController.getConfirmation resolves the landlord via retrieveLandlordByBaseUserId, which only returns IndividualLandlords. Pre-existing and out of scope here, so the integration test asserts the email and carries a // TODO: PDJB-1392 where the confirmation page assertion belongs.
  • Naming. Following review, the identifiers this PR introduces use Organisational.... The pre-existing OrganisationLandlord entity and the ORGANISATION_LANDLORD_REGISTRATION feature flag are deliberately untouched - a separate PR will rename those.
  • The template was verified against the live Notify API via NotifyEmailTemplateTests, so the source-controlled markdown matches Notify exactly.

Pre-release steps

NotifyEmailTemplateTests only checks the template ID for the Notify service its API key belongs to (non-prod, test_id), and is skipped when EMAILNOTIFICATIONS_APIKEY is unset - so CI does not cover any of the below.

  • test & nft - check the Notify template ID for ORGANISATIONAL_LANDLORD_REGISTRATION_CONFIRMATION_EMAIL is correct
  • prod - check the Notify template ID is correct
  • prod - check the email template matches pre-prod

Checklist

  • Unit tests for new logic (e.g. new service methods) have been added
  • New email templates have been added to /src/main/kotlin/resources/emails/emailTemplates.json
  • Test suite has been run in full locally and is passing
  • Branch has been rebased onto main and run locally, with everything working as expected (both for your new feature
    and any related functionality)
  • TODO comments referencing this JIRA ticket have been searched for and removed - two TODOs referencing future
    tickets remain: PDJB-1274 (reassess the recipient address and name once there is a general way to email a landlord)
    and PDJB-1392 (assert the confirmation page in the integration test)
  • Any special release instructions (e.g. the database will need resetting, emails to be added/removed) have been to the relevant release
    ticket on the Jira board, referencing your ticket number
  • QA instructions have been added to the ticket (particularly if this is the last PR required to complete the ticket)
  • This feature is behind a feature flag. I've checked that there will be no change in function if the feature flag is disabled

PDJB-1282 has landed, so OrgLandlordRegistrationCyaStepConfig now populates
organisationRegistrantEmail from the email step rather than hardcoding "".
Switch the confirmation email recipient from the organisation address to the
registrant's, and drop the TODO that was tracking this.
@Bill-Haigh
Bill-Haigh force-pushed the feat/PDJB-1260-org-landlord-registration-confirmation-email branch from f3da80f to 54fe701 Compare July 30, 2026 15:42
@Bill-Haigh
Bill-Haigh marked this pull request as ready for review July 31, 2026 08:13

@danielledias-MT danielledias-MT left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with minor suggestions

@samyou-softwire samyou-softwire left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, couple comments on namings/todos

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we're adding new emails, we should have a pre release step to

  • on test/nft & prod to check the notify email template IDs are correct
  • on prod the email template matches pre-prod

since our automated testing won't cover this

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do our notify tests not check prod notify? (Genuine question - I know they check our lower env notify)

Address review comments: extract the personalisation keys into private
constants and declare the explicit HashMap<String, String> return type, as
the majority of models in this package already do. Key strings and emitted
map are unchanged.
Rename the identifiers introduced by this PR from Organisation to
Organisational, and add the TODOs requested in review.

- OrganisationLandlordRegistrationConfirmationEmail ->
  OrganisationalLandlordRegistrationConfirmationEmail
- ORGANISATION_LANDLORD_REGISTRATION_CONFIRMATION_EMAIL ->
  ORGANISATIONAL_LANDLORD_REGISTRATION_CONFIRMATION_EMAIL
- OrganisationLandlordRegistrationConfirmation.md ->
  OrganisationalLandlordRegistrationConfirmation.md
- sendOrganisationRegistrationConfirmationEmail ->
  sendOrganisationalRegistrationConfirmationEmail
- Add TODO PDJB-1274 on reassessing the recipient address and name
- Retarget the confirmation page TODO from PDJB-1180 to PDJB-1392

The pre-existing OrganisationLandlord entity and the
ORGANISATION_LANDLORD_REGISTRATION feature flag are intentionally left
unchanged; those are covered by a separate PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants