forked from mozilla/blurts-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle unsubscribe flow refreshes/unsub form resubmits
- Moves unsubscribe survey into separate template - Allows user to refresh an unsubmitted survey form without being redirected to ("/"); - Prevents users from submitting multiple unsubscribe surveys - Throws "this email is not subscribed to Firefox Monitor" error when users refresh the unsubscribe survey page after submitting an answer.
- Loading branch information
1 parent
76c953a
commit 9033f74
Showing
5 changed files
with
92 additions
and
59 deletions.
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
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 |
---|---|---|
@@ -1,50 +1,19 @@ | ||
{{!< default }} | ||
<div class="sub-page-content"> | ||
{{#if unsubscribed }} | ||
<section class="unsubscribe-content section-wrapper"> | ||
<h2 class="section-headline whole"> | ||
You are no longer subscribed. | ||
</h2> | ||
<p class="whole sub-head"> | ||
Your email is unsubscribed from Firefox Monitor. Thank you for using this service. Will you take a moment to answer one question about your experience? | ||
</p> | ||
</section><!--.unsubscribe-content.section-wrapper--> | ||
<section class="unsubscribe-survey section-wrapper drop-shadow"> | ||
<div class="whole"> | ||
<form action="" method="post" id="unsubscribe-survey-form" class="form-group"> | ||
<span class="secondary-title whole" tabindex="1">Why are you unsubscribing from Firefox Monitor alerts?</span> | ||
{{#each UNSUB_REASONS}} | ||
<div class="radio-button-group" tabindex="1"> | ||
<input id="reason{{ id_number }}" type="radio" name="unsubscribe-reason" value="{{ value }}" /> | ||
<span class="radio-dot"></span> | ||
<label for="reason{{ id_number }}">{{ value }}</label> | ||
</div> | ||
{{/each}} | ||
<div class="input-group-button"> | ||
<span class="thank-you-message">Thank you for your feedback.</span> | ||
<span class="error-message">Please select one.</span> | ||
<input id="unsubscribe-survey-submit" type="submit" class="button submit transparent-button" value="Unsubscribe" tabindex="1" /> | ||
<img class="loader" src="/img/loader.gif" alt="loading data" /> | ||
</div> | ||
</form> | ||
</div> | ||
</section> | ||
{{ else }} | ||
<section class="unsubscribe-content section-wrapper"> | ||
<h2 class="section-headline whole" tabindex="1">Unsubscribe from Firefox Monitor</h2> | ||
<p class="whole sub-head" tabindex="1"> | ||
This will remove your email from the Firefox Monitor list and you will no longer receive alerts when new breaches are announced. | ||
</p> | ||
<div class="half"> | ||
<form action="/user/unsubscribe" class="form-group" method="post" id="unsubscribe-form"> | ||
<input type="hidden" name="token" value="{{ token }}"> | ||
<input type="hidden" name="emailHash" value="{{ hash }}"> | ||
<div class="input-group-button"> | ||
<input type="submit" class="button submit transparent-button" value="Unsubscribe" data-server-url="{{ SERVER_URL }}"> | ||
<img class="loader" src="/img/loader.gif" alt="loading data" /> | ||
</div> | ||
</form> | ||
</div> | ||
</section> | ||
{{/if}} | ||
<section class="unsubscribe-content section-wrapper"> | ||
<h2 class="section-headline whole" tabindex="1">Unsubscribe from Firefox Monitor</h2> | ||
<p class="whole sub-head" tabindex="1"> | ||
This will remove your email from the Firefox Monitor list and you will no longer receive alerts when new breaches are announced. | ||
</p> | ||
<div class="half"> | ||
<form action="/user/unsubscribe" class="form-group" method="post" id="unsubscribe-form"> | ||
<input type="hidden" name="token" value="{{ token }}"> | ||
<input type="hidden" name="emailHash" value="{{ hash }}"> | ||
<div class="input-group-button"> | ||
<input type="submit" class="button submit transparent-button" value="Unsubscribe" data-server-url="{{ SERVER_URL }}"> | ||
<img class="loader" src="/img/loader.gif" alt="loading data" /> | ||
</div> | ||
</form> | ||
</div> | ||
</section> | ||
</div> |
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,31 @@ | ||
{{!< default }} | ||
<div class="sub-page-content"> | ||
<section class="unsubscribe-content section-wrapper"> | ||
<h2 class="section-headline whole"> | ||
You are no longer subscribed. | ||
</h2> | ||
<p class="whole sub-head"> | ||
Your email is unsubscribed from Firefox Monitor. Thank you for using this service. Will you take a moment to answer one question about your experience? | ||
</p> | ||
</section><!--.unsubscribe-content.section-wrapper--> | ||
<section class="unsubscribe-survey section-wrapper drop-shadow"> | ||
<div class="whole"> | ||
<form action="" method="post" id="unsubscribe-survey-form" class="form-group"> | ||
<span class="secondary-title whole" tabindex="1">Why are you unsubscribing from Firefox Monitor alerts?</span> | ||
{{#each UNSUB_REASONS}} | ||
<div class="radio-button-group" tabindex="1"> | ||
<input id="reason{{ id_number }}" type="radio" name="unsubscribe-reason" value="{{ value }}" /> | ||
<span class="radio-dot"></span> | ||
<label for="reason{{ id_number }}">{{ value }}</label> | ||
</div> | ||
{{/each}} | ||
<div class="input-group-button"> | ||
<span class="thank-you-message">Thank you for your feedback.</span> | ||
<span class="error-message">Please select one.</span> | ||
<input id="unsubscribe-survey-submit" type="submit" class="button submit transparent-button" value="Unsubscribe" tabindex="1" /> | ||
<img class="loader" src="/img/loader.gif" alt="loading data" /> | ||
</div> | ||
</form> | ||
</div> | ||
</section> | ||
</div> |