Skip to content

Commit

Permalink
Merge pull request #1598 from alphagov/more-tracking-fixes
Browse files Browse the repository at this point in the history
More tracking fixes
  • Loading branch information
andysellick authored Aug 24, 2023
2 parents b4073ce + d7e17cf commit e0f6cd2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion app/controllers/subscriptions_management_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def change_frequency

flash[:success] = {
message: t("subscriptions_management.change_frequency.success", subscription_title:, frequency: frequency_text),
message_en: t("subscriptions_management.change_frequency.success", subscription_title:, frequency: frequency_text, locale: :en),
}

redirect_to list_subscriptions_path
Expand Down Expand Up @@ -67,6 +68,7 @@ def change_address
)
flash[:success] = {
message: t("subscriptions_management.update_address.success", address: new_address),
message_en: t("subscriptions_management.update_address.success", address: new_address, locale: :en),
}

redirect_to list_subscriptions_path
Expand All @@ -83,8 +85,8 @@ def confirmed_unsubscribe_all
GdsApi.email_alert_api.unsubscribe_subscriber(authenticated_subscriber_id)
flash[:success] = {
message: t("subscriptions_management.confirmed_unsubscribe_all.success_message"),
message_en: t("subscriptions_management.confirmed_unsubscribe_all.success_message", locale: :en),
description: t("subscriptions_management.confirmed_unsubscribe_all.success_description"),
description_en: t("subscriptions_management.confirmed_unsubscribe_all.success_description", locale: :en),
}
rescue GdsApi::HTTPNotFound
# The user has already unsubscribed.
Expand Down
1 change: 1 addition & 0 deletions app/controllers/unsubscriptions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def confirmed
if authenticated?
flash[:success] = {
message: t("subscriptions_management.index.unsubscribe.message", title: @title),
message_en: t("subscriptions_management.index.unsubscribe.message", title: @title, locale: :en),
description: t("subscriptions_management.index.unsubscribe.description"),
}

Expand Down
2 changes: 1 addition & 1 deletion app/views/subscriptions_management/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
ga4_data = {
event_name: "form_complete",
type: "email subscription",
text: flash[:success]["description_en"],
text: flash[:success]["message_en"],
section: t("subscriptions_management.heading", locale: :en),
action: "complete",
tool_name: "Get emails from GOV.UK"
Expand Down

0 comments on commit e0f6cd2

Please sign in to comment.