Giter Club home page Giter Club logo

email-alert-api's Introduction

email-alert-api

Sends emails to users that subscribe to specific GOV.UK email alerts.

Provides a consistent internal interface to external email notification services. Currently supports only GOV.UK Notify.

Nomenclature

  • Content change:

    • A publication event that creates or changes a content item
    • The representation of that event for the purpose of sending emails
  • Message:

    • A message, distinct from a content change, that can be sent to subscribers of a list
    • The representation of that event for the purpose of sending emails
  • Subscriber list:

    • A particular titled list that a user can sign up to
    • Contains criteria to determine which notifications a subscriber will receive (eg. all publications by HMRC)
  • Subscriber:

    • A user who has subscribed to one or more subscriber lists
  • Subscription:

    • The relationship between a subscriber and the subscription lists they are subscribed to
  • Digest run:

    • One batch of either daily or weekly digests representing a particular subscription that has a start and end time and a set of subscribers to send emails to
  • Email:

    • An email generated from content changes or messages to be sent to subscribers

Technical documentation

This is a Ruby on Rails app, and should follow our Rails app conventions.

You can use the GOV.UK Docker environment to run the application and its tests with all the necessary dependencies. Follow the usage instructions to get started.

Use GOV.UK Docker to run any commands that follow.

Running the test suite

bundle exec rake

Further documentation

Check the docs/ directory for detailed instructions, decisions and other documentation.

Licence

MIT License

email-alert-api's People

Contributors

1pretz1 avatar barrucadu avatar benthorner avatar bestie avatar brucebolt avatar cbaines avatar chao-xian avatar chrisbashton avatar deborahchua avatar dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar dwhenry avatar edwardkerry avatar elliotcm avatar evilstreak avatar gpeng avatar hannako avatar huwd avatar kalleth avatar kevindew avatar kludgekml avatar koetsier avatar murilodalri avatar rubenarakelyan avatar sengi avatar theseanything avatar thomasleese avatar tijmenb avatar tuzz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

email-alert-api's Issues

Manage subscriptions link has email in query params

As part of alphagov/email-alert-frontend#639, @kevindew identified that we include the user's email address in plaintext form in the query params of the "View, unsubscribe or change the frequency of your subscriptions" link.

This means the user's email address will be present in logs, which isn't ideal. Although for analytics we filter emails before the reach GA, this would be difficult to replicate for logs.

We should consider how we can avoid having plaintext emails in the query params for managing subscriptions. There are a couple of approaches we could take here:

  • Don't include it in the first place. This would mean the user has to enter their email manually as part of signing-in, which would increase of overhead for this workflow.

  • Encrypt the email in a (non-expiring) token. This would require changes to the frontend (to accept the token) and the API (to change it in emails). We would also need to support the old behaviour.

If we're going to include verifiable/encrypted information in the "View, unsubscribe or change the frequency of your subscriptions" link, it may be simpler to support direct sign-in, with a suitable expiry.

GOV.UK keeps randomly changing my email preferences without me asking it to

GOV.UK has now twice unilaterally decided to change my email preferences. I set them how I wanted them, stop bloody second-guessing me! And why is it so painful to change them anyway? Surely the "we've changed your email preferences" email should have a link to change them back, rather than a link to where I type my email address, press submit, and then get another email telling me to reset my email preferences.

It's apparently doing this to "make the number of emails you get more manageable.". The number of emails I get is perfectly manageable, at less than one a day. Why is it doing this? I get more emails from this spammy piece of nonsense and then having to get another email to reset my preferences back to how I want them, than I do actual emails with content.

Please reverse this ill-conceived feature.

Unused endpoint to send a single email

In 2019 we added an endpoint to send a single email: #935.

I suspect the endpoint is unused, and leaving it is just a source of confusion, especially since we have other means to send bespoke email, which seem to be more popular in practice.

Accept only JSON requests

Should we only be allowing requesting in JSON format for this application? Am I correct in assuming that all GOV.UK APIs accept only JSON requests? If so perhaps this should be enforced within email-alert-api. Currently our tests are all accepting HTML type requests and do not reflect how we communicate with this application from places such as specialist-publisher.

Handling of unpublishing events is inconsistent and incomplete

This is a central issue to document the proposal to remove this feature from the email system, for the following reasons:

  • It only works for topic taxons.

  • It only works if the unpublished taxon was redirected.

  • It is not monitored, so we don't know if the functionality works.

  • It renders email using ERB, unlike the rest of the system.

  • It arbitrarily culls any lists that refer to other taxons as well.

  • We have no evidence it meets user needs.

It's also entirely undocumented, yet occupies a large part of the email system. Since the Notifications team is pausing, we think it will be faster to just remove it now, rather than try to document it and remove it later.

The general problem of dead lists is documented here as GOV.UK Tech Debt. Rather than keep a flawed solution, we've agreed at a product level that it makes sense to tackle this problem comprehensively, from scratch.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.