Skip to content

Commit 02cca77

Browse files
committed
Remove MMRV vaccination workaround in notify templates
We were using a workaround to ensure parents only received comms for MMR even if the patient was eligible for MMRV. This is because we hadn't built support for MMRV consent just yet. Now that we have this support, we can get rid of the workaround and directly use the `vaccination` variable which uses the programmes the patient is eligible for. This requires updating some of the notify templates to no longer use `vaccination_sms`.
1 parent b6ca9e4 commit 02cca77

3 files changed

Lines changed: 13 additions & 23 deletions

File tree

app/lib/govuk_notify_personalisation.rb

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ def to_h
8383
team_privacy_policy_url:,
8484
today_or_date_of_vaccination:,
8585
vaccination:,
86-
vaccination_sms:,
8786
vaccination_and_dates:,
8887
vaccination_and_dates_sms:,
8988
vaccination_and_method:,
@@ -495,19 +494,6 @@ def vaccination
495494
end
496495
end
497496

498-
# TODO: Remove this method when schools start offering MMRV.
499-
# When that happens:
500-
# - Remove vaccination_sms method and use vaccination instead
501-
# - Update email template 5462c441-81c0-4ac0-821f-713b4178f8ba to use
502-
# vaccination variable instead of hardcoded 'MMR catch-up vaccinations'
503-
def vaccination_sms
504-
if is_catch_up? && mmr_programme&.mmrv_variant?
505-
return vaccination&.gsub("MMRV", "MMR")
506-
end
507-
508-
vaccination
509-
end
510-
511497
def vaccination_and_dates
512498
if next_or_today_session_dates_or.present?
513499
"#{vaccination} on #{next_or_today_session_dates_or}"
@@ -519,9 +505,9 @@ def vaccination_and_dates
519505
# TODO: Remove this method when schools start offering MMRV.
520506
def vaccination_and_dates_sms
521507
if next_or_today_session_dates_or.present?
522-
"#{vaccination_sms} on #{next_or_today_session_dates_or}"
508+
"#{vaccination} on #{next_or_today_session_dates_or}"
523509
else
524-
vaccination_sms
510+
vaccination
525511
end
526512
end
527513

config/initializers/govuk_notify.rb

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"3523d4b8-530b-42dd-8b9b-7fed8d1dfff1",
1616
consent_school_initial_reminder_flu: "7f85a5b4-5240-4ae9-94f7-43913852943c",
1717
consent_school_initial_reminder_hpv: "0d78bff0-9dde-4192-8cf8-10e83486b54f",
18-
consent_school_initial_reminder_mmr: "5462c441-81c0-4ac0-821f-713b4178f8ba",
18+
consent_school_initial_reminder_mmr: "fe47875a-a0a6-40d9-bd41-a411ebb31cff",
1919
consent_school_request_doubles: "9b1a015d-6caa-47c5-a223-f72377586602",
2020
consent_school_request_flu: "017853bc-2b35-4aff-99b1-193e514613a0",
2121
consent_school_request_hpv: "7b9bb010-0742-460a-ae25-1922355b6776",
@@ -57,9 +57,9 @@
5757
clinic_subsequent_invitation_ryg: "018f146d-e7b7-4b63-ae26-bb07ca6fe2f9",
5858
consent_clinic_request: "03a0d572-ca5b-417e-87c3-838872a9eabc",
5959
consent_confirmation_given: "8eb8d05e-b8d8-4bf9-8a38-c009ae989a4e",
60-
consent_confirmation_refused: "e871e7d5-06be-48d1-81ba-38ddecae46e2",
61-
consent_school_reminder: "b9c0c3fb-24f1-4647-a2a1-87389cec9942",
62-
consent_school_request: "12f90b2d-33a5-429c-9ed7-0aa2823eb3ac",
60+
consent_confirmation_refused: "234b7479-1968-4f57-a6bf-20e402c8da39",
61+
consent_school_reminder: "26029539-60e4-416b-a3a8-40b82c2babc1",
62+
consent_school_request: "2d3e2370-7faa-4798-b7ae-607692a85059",
6363
consent_unknown_contact_details_warning:
6464
"1fd4620d-1c96-4af1-b047-ed13a90b0f44",
6565
session_school_reminder: "cc4a7f89-d260-461c-80f0-7e6e9af75e7a",
@@ -71,6 +71,11 @@
7171
# Here we track email and SMS templates that we used to send but no longer
7272
# do. We need these to be able to display the names of the templates.
7373
GOVUK_NOTIFY_UNUSED_TEMPLATES = {
74+
"e871e7d5-06be-48d1-81ba-38ddecae46e2" => :consent_confirmation_refused,
75+
"b9c0c3fb-24f1-4647-a2a1-87389cec9942" => :consent_school_reminder,
76+
"12f90b2d-33a5-429c-9ed7-0aa2823eb3ac" => :consent_school_request,
77+
"5462c441-81c0-4ac0-821f-713b4178f8ba" =>
78+
:consent_school_initial_reminder_mmr,
7479
"07516fbf-6d51-4c17-a046-305f5baa6744" => :vaccination_administered_flu,
7580
"3179b434-4f44-4d47-a8ba-651b58c235fd" => :consent_confirmation_given,
7681
"eb34f3ab-0c58-4e56-b6b1-2c179270dfc3" => :consent_confirmation_refused,

spec/lib/govuk_notify_personalisation_spec.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@
109109
team_privacy_notice_url: "https://example.com/privacy-notice",
110110
team_privacy_policy_url: "https://example.com/privacy-policy",
111111
vaccination: "HPV vaccination",
112-
vaccination_sms: "HPV vaccination",
113112
vaccination_and_dates: "HPV vaccination on Thursday 1 January",
114113
vaccination_and_dates_sms: "HPV vaccination on Thursday 1 January",
115114
vaccination_and_method: "HPV vaccination",
@@ -134,8 +133,8 @@
134133
let(:programmes) { [Programme.mmr] }
135134
let(:date_of_birth) { Programme::MIN_MMRV_ELIGIBILITY_DATE + 1.month }
136135

137-
it { should include(vaccination_sms: "MMR vaccination") }
138-
it { should include(vaccination_and_dates_sms: "MMR vaccination") }
136+
it { should include(vaccination: "MMRV vaccination") }
137+
it { should include(vaccination_and_dates_sms: "MMRV vaccination") }
139138

140139
it "generates consent link with mmrv variant" do
141140
expect(to_h[:consent_link]).to end_with("/mmrv/start")

0 commit comments

Comments
 (0)