Skip to content

Commit

Permalink
Remove old_unclassified_updated email
Browse files Browse the repository at this point in the history
Remove email notifications sent to requesters when others classify
their requests.

These notifications were causing confusion and generating unnecessary
support.

Fixes #2733
Fixes #8331
  • Loading branch information
gbp committed Feb 13, 2025
1 parent 1811cc2 commit e785dae
Show file tree
Hide file tree
Showing 9 changed files with 3 additions and 159 deletions.
13 changes: 1 addition & 12 deletions app/mailers/request_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class RequestMailer < ApplicationMailer
before_action :set_footer_template,
only: [
:new_response, :overdue_alert, :very_overdue_alert,
:new_response_reminder_alert, :old_unclassified_updated,
:new_response_reminder_alert,
:not_clarified_alert, :comment_on_alert,
:comment_on_alert_plural
]
Expand Down Expand Up @@ -152,17 +152,6 @@ def new_response_reminder_alert(info_request, incoming_message)
)
end

# Tell the requester that someone updated their old unclassified request
def old_unclassified_updated(info_request)
@url = request_url(info_request)
@info_request = info_request

mail_user(
info_request.user,
subject: -> { _("Someone has updated the status of your request") }
)
end

# Tell the requester that they need to clarify their request
def not_clarified_alert(info_request, incoming_message)
respond_url = new_request_incoming_followup_url(
Expand Down
5 changes: 0 additions & 5 deletions app/models/info_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1029,11 +1029,6 @@ def set_described_state(new_state, set_by = nil, message = "")
RequestMailer.requires_admin(self, set_by, message).deliver_now
end
end

unless set_by.nil? || is_actual_owning_user?(set_by) || described_state == 'attention_requested'
RequestMailer.
old_unclassified_updated(self).deliver_now unless is_external?
end
end

# Work out what state to display for the request on the site. In addition to values of
Expand Down
16 changes: 0 additions & 16 deletions app/views/request_mailer/old_unclassified_updated.text.erb

This file was deleted.

3 changes: 2 additions & 1 deletion doc/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

## Highlighted Features

Add additional InfoRequest embargo scopes (Graeme Porteous)
* Removed `old_unclassified_updated` email (Graeme Porteous)
* Add additional InfoRequest embargo scopes (Graeme Porteous)

# 0.45.3.1

Expand Down
5 changes: 0 additions & 5 deletions lib/tasks/translation.rake
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,6 @@ namespace :translation do
'Telling the requester that they need to say if the new response contains info or not',
output_file)

old_unclassified_email = RequestMailer.old_unclassified_updated(info_request)
write_email(old_unclassified_email,
'Telling the requester that someone updated their old unclassified request',
output_file)

not_clarified_alert_email = RequestMailer.not_clarified_alert(info_request, incoming_message)
write_email(not_clarified_alert_email,
'Telling the requester that they need to clarify their request',
Expand Down
21 changes: 0 additions & 21 deletions spec/controllers/classifications_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -194,15 +194,6 @@ def post_status(status, message: nil)
expect(classification.info_request_event).to eq(last_event)
end

it 'should send an email to the requester letting them know someone has
updated the status of their request' do
mail_mock = double('mail')
allow(mail_mock).to receive :deliver_now
expect(RequestMailer).to receive(:old_unclassified_updated).
and_return(mail_mock)
post_status('rejected')
end

it 'should redirect to the request page' do
post_status('rejected')
expect(response).to redirect_to(
Expand Down Expand Up @@ -241,12 +232,6 @@ def post_status(status, message: nil)
expect(last_event.params).to eq expected_params
end

it 'should not send an email to the requester letting them know ' \
'someone has updated the status of their request' do
expect(RequestMailer).not_to receive(:old_unclassified_updated)
post_status('rejected')
end

it 'should show advice for the new state' do
post_status('rejected')
expect(flash[:notice][:partial]).to eq(
Expand Down Expand Up @@ -328,12 +313,6 @@ def post_status(status, message: nil)
expect(last_event.params).to eq expected_params
end

it 'should not send an email to the requester letting them know someone
has updated the status of their request' do
expect(RequestMailer).not_to receive(:old_unclassified_updated)
post_status('rejected')
end

it 'should go to the page asking for more information when ' \
'classified as requires_admin' do
post_status('requires_admin')
Expand Down
4 changes: 0 additions & 4 deletions spec/mailers/previews/request_mailer_preview.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ def new_response_reminder_alert
RequestMailer.new_response_reminder_alert(info_request, incoming_message)
end

def old_unclassified_updated
RequestMailer.old_unclassified_updated(info_request)
end

def not_clarified_alert
RequestMailer.not_clarified_alert(info_request, incoming_message)
end
Expand Down
45 changes: 0 additions & 45 deletions spec/mailers/request_mailer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -518,51 +518,6 @@ def sent_alert_params(request, type)
end
end

describe "when sending mail when someone has updated an old unclassified request" do
let(:user) do
FactoryBot.create(:user, name: "test name", email: "email@localhost")
end

let(:public_body) { FactoryBot.create(:public_body, name: "Test public body") }

let(:info_request) do
FactoryBot.create(:info_request, user: user,
title: "Test request",
public_body: public_body,
url_title: "test_request")
end

let(:mail) { RequestMailer.old_unclassified_updated(info_request) }

before do
allow(info_request).to receive(:display_status).and_return("refused.")
end

it 'should have the subject "Someone has updated the status of your request"' do
expect(mail.subject).to eq('Someone has updated the status of your request')
end

context "when the user does not use default locale" do
before do
info_request.user.locale = 'es'
end

it "translates the subject" do
expect(mail.subject).to eq(
'Alguien ha actualizado el estado de tu solicitud'
)
end
end

it 'should tell them what status was picked' do
expect(mail.body).to match(/"refused."/)
end

it 'should contain the request path' do
expect(mail.body).to match(/request\/test_request/)
end
end

describe "when generating a fake response for an upload" do
before do
@foi_officer = mock_model(User, name_and_email: "FOI officer's name and email")
Expand Down

This file was deleted.

0 comments on commit e785dae

Please sign in to comment.