-
Notifications
You must be signed in to change notification settings - Fork 9
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
Bulk unsubscribe Candidates in Support #10228
Conversation
e529ad8
to
250b962
Compare
250b962
to
c2c147f
Compare
f16dee0
to
26ee4ba
Compare
Trello: https://trello.com/c/R8vZn7iE |
Added a Bulk Unsubscribe Form Added a Bulk Unsubscribe Worker Added a Bulk Unsubscribe Service Unsubscribing is performed by `update_all` in batches to ensue performance
26ee4ba
to
de11e6c
Compare
.split("\n") | ||
.map(&:strip) | ||
.compact_blank | ||
Support::Candidates::BulkUnsubscribeWorker.perform_async(unsubscribe_email_addresses) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Presumably we are doing this async because we are anticipating putting A LOT of email addresses in the box? Just wondering.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah future proofing to be honest - currently we have about 14 to do. My thoughts were that this sets us up to handle bulk through an API - that'd be ideal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one!
Renames `.erb-lint.yml` to `.erb_lint.yml` as suggested in [lint failures](https://github.com/DFE-Digital/apply-for-teacher-training/actions/runs/12693098266/job/35381314500?pr=10228) >The config file has been renamed to `.erb_lint.yml` and `.erb-lint.yml` is deprecated. Please rename your config file to `.erb_lint.yml`.
require 'rails_helper' | ||
|
||
RSpec.describe SupportInterface::Candidates::BulkUnsubscribe do | ||
describe '.bulk_unsubscribe' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we add a test that shows if an email address is included that doesn't actually belong to a candidate, it doesn't break the job?
I'm thinking of the scenario where a candidate changes their email address between clicking the unsubscribe button via notify and someone running this job.
expect(candidate2.reload).to be_unsubscribed_from_emails | ||
end | ||
|
||
it 'can handle unknown email addresses' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Context
When users unsubscribe from bespoke Notify emails, their email address is exportable from the Notify service and does not automatically unsubscribe them from emails in Apply.
Manual intervention is required to export these email addresses from Notify and update the Candidate in Apply, this PR aims to provide an interface in the Support Console to enable us to update Candidates unsubscribe preferences.
Changes proposed in this pull request
New UI
Screen.Recording.2025-01-09.at.15.16.15.mov
Guidance to review
Things to check