Skip to content

Adding ability to access the GOV.UK Notify response#200

Open
Hassanmir92 wants to merge 1 commit intodxw:mainfrom
Hassanmir92:main
Open

Adding ability to access the GOV.UK Notify response#200
Hassanmir92 wants to merge 1 commit intodxw:mainfrom
Hassanmir92:main

Conversation

@Hassanmir92
Copy link
Copy Markdown

@Hassanmir92 Hassanmir92 commented Feb 26, 2026

Why

Mail::Notify::DeliveryMethod defines attr_accessor :response but never assigns the response returned by Notifications::Client#send_email.

As a result:

  • delivery_method.response is always nil
  • Consumers cannot access the GOV.UK Notify notification ID after sending

Since Notify already returns a response object synchronously, this information is available but not set.

What

This PR updates the deliver! method to assign the return value of client.send_email to self.response.

This:

  • Preserves existing return behaviour.
  • Makes the Notify response accessible via message.delivery_method.response

This enables auditing, correlation, and delivery status tracking without custom overrides.

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.

1 participant