Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add document collection ids to the links payload for email alert api #577

Closed
wants to merge 2 commits into from

Conversation

hannako
Copy link
Contributor

@hannako hannako commented Nov 14, 2022

This is needed to support
alphagov/email-alert-api#1803

When a user signs up to alerts on a document collection, research has shown an
expectation of being notified when changes are made to documents within that collection.

The message that publishing API puts onto rabbit contains the expanded links (see eg here
https://deploy.integration.publishing.service.gov.uk/job/run-rake-task/305143/console) but
email alert service only forwards some of this to Email Alert API:

  • To support topic taxonomy based emails, this application creates a custom taxon_tree
    attribute populated from content_ids in the taxon attribute of expanded links.
  • Following that pattern, this commit adds a document collection attribute, populated
    with content ids plucked from the document collection attribute of expanded links

Trello card: https://trello.com/c/tJvdhfdd/1455-support-topic-like-subscriptions-for-document-collections-email-alert-api-s

⚠️ This repo is Continuously Deployed: make sure you follow the guidance ⚠️

This is needed to support
alphagov/email-alert-api#1803

When a user signs up to alerts on a document collection, research has shown an
expectation of being notified when changes are made to documents within that collection.

The message that publishing API puts onto rabbit contains the expanded links (see eg here
https://deploy.integration.publishing.service.gov.uk/job/run-rake-task/305143/console) but
email alert service only forwards some of this to Email Alert API:

  - To support topic taxonomy based emails, this application creates a custom `taxon_tree`
attribute populated from content_ids in the taxon attribute of expanded links.
  - Following that pattern, this commit adds a document collection attribute, populated
with content ids plucked from the document collection attribute of expanded links
@hannako hannako changed the title Add document collection id's to the links payload for email alert api Add document collection ids to the links payload for email alert api Nov 14, 2022
hannako added a commit to alphagov/email-alert-api that referenced this pull request Nov 14, 2022
When a user signs up to alerts on a document collection, research
has shown an expectation of being notified when changes are made to
documents within that collection.

The relationship between a document collection and the documents it
contains is stored in the links attribute sent to this application by
email alert service. See [1]

The current logic that matches subscriber lists to a content change
matches on content ID AND tags or links. This code was added in [2] when we began
supporting single page email notifications. I've followed that pattern here. eg
if the ContentChange has tags as well as a content id, the SubscriberListQuery will
only match it to a subscriber list if it matches on the tags AND the content ID.

In the case of a user being subscribed to a single page AND a collection
that includes that page, they will recieve two emails.

[1] alphagov/email-alert-service#577
[2] 069ef4e
hannako added a commit to alphagov/email-alert-api that referenced this pull request Nov 14, 2022
When a user signs up to alerts on a document collection, research
has shown an expectation of being notified when changes are made to
documents within that collection.

The relationship between a document collection and the documents it
contains is stored in the links attribute sent to this application by
email alert service. See [1]

The current logic that matches subscriber lists to a content change
matches on content ID AND tags or links. This code was added in [2] when we began
supporting single page email notifications. I've followed that pattern here. eg
if the ContentChange has tags as well as a content id, the SubscriberListQuery will
only match it to a subscriber list if it matches on the tags AND the content ID.

In the case of a user being subscribed to a single page AND a collection
that includes that page, they will recieve two emails.

[1] alphagov/email-alert-service#577
[2] 069ef4e
@hannako hannako marked this pull request as ready for review November 14, 2022 21:51
Copy link
Contributor

@KludgeKML KludgeKML left a comment

Choose a reason for hiding this comment

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

Looks good to me!

Copy link

@chao-xian chao-xian left a comment

Choose a reason for hiding this comment

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

nelc7gnbyoy51

@hannako
Copy link
Contributor Author

hannako commented Nov 29, 2022

This PR has been superseded by #583

@hannako hannako closed this Nov 29, 2022
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.

3 participants