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

Enable users to signup to all content by organisation #451

Merged
merged 4 commits into from
Apr 18, 2019

Conversation

bilbof
Copy link
Contributor

@bilbof bilbof commented Apr 11, 2019

This will enable users to subscribe to organisations content items via the /email-signup?link=ministry-of-magic endpoint.

It will behave in the same way as the taxonomy signup does currently.

Most of the changes are related to generalising the existing taxonomy endpoint to support all links, not just taxons.

I refactored the taxonomy code and then added in the organisations logic. It'll be easiest to review commit by commit.

Trello: https://trello.com/c/KsDrrchK/620.

Go to https://finder-frontend-pr-X.herokuapp.com/email-signup?link=hm-treasury to try it out.

Views:

Screen Shot 2019-04-11 at 17 00 40
Screen Shot 2019-04-11 at 17 00 35

William Franklin added 4 commits April 11, 2019 12:06
This is a refactor, it wont change things for end users.
The intent is to make it easier to add estimates for other content items
in the future.

In a commit to follow I will make it possible to estimate the weekly
email volume for people and so on.
This replaces the TaxonomySignup model with a new model,
ContentItemSubscriberList.

End users wont see a change as a result of this commit.
The intent is to make it possible to give an arbitrary
content item to the ContentItemSubscriberList and have it
return a subscriber list for that content item.

TaxonomySignup does this just for taxons. Now we can use
ContentItemSubscriberList to generate subscriber lists
for people, organisations, and so on.

In a future commit I will use this class to generate
subscriber lists for organisations.
This lets one use /email-signup?link=/path-to-content-item to subscribe
to permitted content items, rather than subscribing just to e.g. ?topic=/education.

As with the past couple of commits, this is just a minor refactor,
moving things around, generalising taxon to content_item.

End users wont see a change as result of this commit.

In a following commit I will make it possible to subscribe
to organisations via this endpoint.
This will enable users to subscribe to organisations content items
via the /email-signup?link=ministry-of-magic endpoint.

It will behave in the same way as the topic signup does
currently.

Trello: https://trello.com/c/KsDrrchK/620.
@bilbof bilbof changed the title Generalize taxonomy signup Enable users to signup to all content by organisation Apr 11, 2019
bilbof pushed a commit to alphagov/collections that referenced this pull request Apr 12, 2019
This will enable users to subscribe to organisation email alerts
via the EmailAlertFrontend user interface.

**Note:** Should be merged after alphagov/email-alert-frontend#451

Trello: https://trello.com/c/NSJuSR4z/587.
class OrganisationWeeklyEmailVolume
HIGH = '40 - 60'.freeze
MEDIUM = '0 - 20'.freeze
LOW = '0 - 5'.freeze
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these numbers based on anything?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's very much a finger-in-air estimate. This is the same as our estimates for taxonomy emails (which may now be wrong).

This is the explanation in the commit (d4a97b2#diff-5c90fde72d5dd7ed3acd972c5bc07f58) where the taxonomy estimate was added:

These figures are based on analysis of historical email volume.

Perhaps we could make a request to email-alert-api to figure out the exact volume.

Copy link
Contributor

@barrucadu barrucadu left a comment

Choose a reason for hiding this comment

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

Code looks good, but I'm a little wary about the organisation email frequency numbers. Is there some way we can check that (and update the numbers here)?

Copy link
Contributor

@barrucadu barrucadu left a comment

Choose a reason for hiding this comment

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

We're going to return to the number estimate in the future.

@bilbof bilbof merged commit 6fdfc68 into master Apr 18, 2019
@barrucadu barrucadu deleted the generalize-taxonomy-signup branch April 18, 2019 09:32
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.

2 participants