Allow sanitiseContentFor parameter in sendEmail method#231
Open
kr8n3r wants to merge 7 commits into
Open
Conversation
0cb30b2 to
d0f1fe5
Compare
CrystalPea
reviewed
May 7, 2026
Contributor
CrystalPea
left a comment
There was a problem hiding this comment.
Well done on this! I left a couple comments - let me know what you think.
f4bb9c1 to
9618f34
Compare
0a0dac7 to
f512111
Compare
notifications-api accepts `sanitise_content_for` payload - https://github.com/alphagov/notifications-api/blob/main/app/v2/notifications/post_notifications.py#L134 - an array of strings denoting personalisations keys that it sanitises. This PR extends the client to allow this payload to be sent to the API with `santiseContentFor`. Naming matches our other parameters. API also returns `sanitised_content` object - https://github.com/alphagov/notifications-api/blob/main/app/v2/notifications/post_notifications.py#L215 - which we list in the `@returns` object notation.
Adds a defitnion for `sanitiseContentFor` structure and types are.
Adds structure and type definitions for `sanitised_content` object the API returns. `sanitised_content` is always returned, being an empty object if `sanitiseContentFor` is ommited, so it's listed in the `required`. This matches the python implementation - https://github.com/alphagov/notifications-python-client/blob/1902b7d9a062ab101a6e2a1554e5d1c35f7f2179/integration_test/schemas/v2/notification_schemas.py#L162
f512111 to
ac2fb29
Compare
Add unreleased entry for `sanitiseContentFor` optional parameter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does the pull request solve?
notify-api already accepts
sanitize_content_foroptional payload - an array of personalisation keysthat is sanitises.
This PR extends the Node client to accept the optional parameter
sanitiseContentForin the sendEmail methodTests and type definitions also updated.
Input with
sanitiseContentForResponse
Input without
sanitiseContentForResponse
Delivered message with and without sanitisation
Checklist
CHANGELOG.mdpackage.jsonCONTRIBUTING.mdnotifications-node-client/scripts/generate_docker_env.sh