-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add email subscribe/unsubscribe flash messages
When a user completes the single page email subscribe or unsubscribe journey they will be redirected to the page they were on with a message in the account session flash. Check for these messages in the flash and render the appropriate success banner. The pages chosen for phase 1 and phase 2 of the rollout are either `publication` or `detailed_guide` content types, so only add the partial to these templates. In the future when we roll out to more pages we can add the partial to the rest of the content types.
- Loading branch information
1 parent
8e27396
commit 0c88d6f
Showing
6 changed files
with
45 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
app/views/shared/_email_subscribe_unsubscribe_flash.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<% if @account_flash.include?("email-subscription-success") %> | ||
<div class="govuk-grid-row govuk-!-margin-top-7"> | ||
<div class="govuk-grid-column-two-thirds"> | ||
<%= render "govuk_publishing_components/components/success_alert", { | ||
message: sanitize(t("email.subscribe_title")), | ||
description: sanitize(t("email.description_html")) | ||
} %> | ||
</div> | ||
</div> | ||
|
||
<% elsif @account_flash.include?("email-unsubscribe-success") %> | ||
<div class="govuk-grid-row"> | ||
<div class="govuk-grid-column-two-thirds govuk-!-margin-top-7"> | ||
<%= render "govuk_publishing_components/components/success_alert", { | ||
message: sanitize(t("email.unsubscribe_title")), | ||
description: sanitize(t("email.description_html")) | ||
} %> | ||
</div> | ||
</div> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters