From 4e0528589817b683f78ca5a26b5d59a56fb783e1 Mon Sep 17 00:00:00 2001 From: Andrew White Date: Tue, 29 Oct 2024 16:12:29 +0000 Subject: [PATCH] Initial pass at updating emails for the new parliament These can be done after opening: - Debate outcomes - Petition emails - Petition mailshots - Petitions closing early - Petitions being stopped --- app/mailers/application_mailer.rb | 2 +- app/mailers/sponsor_mailer.rb | 7 + ...otify_creator_of_debate_scheduled.html.erb | 18 ++- ...otify_creator_of_debate_scheduled.text.erb | 23 ++- ...ify_creator_of_threshold_response.html.erb | 16 +- ...ify_creator_of_threshold_response.text.erb | 17 +- ...notify_signer_of_debate_scheduled.html.erb | 18 ++- ...notify_signer_of_debate_scheduled.text.erb | 23 ++- ...tify_signer_of_threshold_response.html.erb | 18 +-- ...tify_signer_of_threshold_response.text.erb | 17 +- app/views/layouts/default_mail.html.erb | 39 ++++- .../email_confirmation_for_signer.html.erb | 4 +- .../email_confirmation_for_signer.text.erb | 6 +- .../email_duplicate_signatures.html.erb | 7 +- .../email_duplicate_signatures.text.erb | 6 +- .../gather_sponsors_for_petition.html.erb | 34 ++-- .../gather_sponsors_for_petition.text.erb | 35 ++--- ...otify_creator_of_debate_scheduled.html.erb | 18 ++- ...otify_creator_of_debate_scheduled.text.erb | 23 ++- ...ify_creator_of_threshold_response.html.erb | 16 +- ...ify_creator_of_threshold_response.text.erb | 17 +- ...reator_that_petition_is_published.html.erb | 20 ++- ...reator_that_petition_is_published.text.erb | 18 ++- ...reator_that_petition_was_rejected.html.erb | 17 +- ...reator_that_petition_was_rejected.text.erb | 24 +-- ...notify_signer_of_debate_scheduled.html.erb | 18 ++- ...notify_signer_of_debate_scheduled.text.erb | 23 ++- ...tify_signer_of_threshold_response.html.erb | 18 +-- ...tify_signer_of_threshold_response.text.erb | 17 +- ...ponsor_that_petition_is_published.html.erb | 20 ++- ...ponsor_that_petition_is_published.text.erb | 18 ++- ...ponsor_that_petition_was_rejected.html.erb | 14 +- ...ponsor_that_petition_was_rejected.text.erb | 17 +- ...nd_email_confirmation_for_sponsor.html.erb | 15 +- ...nd_email_confirmation_for_sponsor.text.erb | 10 +- ...nsor_signed_email_below_threshold.html.erb | 9 +- ...nsor_signed_email_below_threshold.text.erb | 9 +- ...sponsor_signed_email_on_threshold.html.erb | 20 +-- ...sponsor_signed_email_on_threshold.text.erb | 28 ++-- config/locales/petitions.en-GB.yml | 50 +++--- ...gns_charlies_petition_as_a_sponsor.feature | 6 +- ...petition_with_suzies_email_address.feature | 6 +- .../debate_scheduled_steps.rb | 4 +- features/step_definitions/moderation_steps.rb | 4 +- features/step_definitions/signature_steps.rb | 9 +- features/step_definitions/sponsor_steps.rb | 10 +- .../sponsor_support_nofitication_steps.rb | 15 +- features/suzie_signs_a_petition.feature | 6 +- .../government_response_controller_spec.rb | 8 +- .../government_response_controller_spec.rb | 8 +- .../admin/moderation_controller_spec.rb | 12 +- .../admin/petitions_controller_spec.rb | 4 +- .../admin/take_down_controller_spec.rb | 8 +- spec/controllers/petitions_controller_spec.rb | 2 +- .../controllers/signatures_controller_spec.rb | 10 +- spec/controllers/sponsors_controller_spec.rb | 18 +-- spec/mailers/archived/petition_mailer_spec.rb | 76 ++++----- spec/mailers/petition_mailer_spec.rb | 145 +++--------------- spec/mailers/sponsor_mailer_spec.rb | 119 +------------- 59 files changed, 535 insertions(+), 664 deletions(-) diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb index 96131de20..205d1f1d9 100644 --- a/app/mailers/application_mailer.rb +++ b/app/mailers/application_mailer.rb @@ -2,7 +2,7 @@ class ApplicationMailer < ActionMailer::Base default_url_options[:protocol] = Site.email_protocol default from: ->(email){ Site.email_from } - helper :date_time, :rejection, :auto_link, :markdown, :moderation + helper :date_time, :rejection, :auto_link, :markdown, :moderation, :number layout 'default_mail' end diff --git a/app/mailers/sponsor_mailer.rb b/app/mailers/sponsor_mailer.rb index 9991e85a4..bfd0b826a 100644 --- a/app/mailers/sponsor_mailer.rb +++ b/app/mailers/sponsor_mailer.rb @@ -1,4 +1,6 @@ class SponsorMailer < ApplicationMailer + include NumberHelper + def sponsor_signed_email_below_threshold(sponsor) @petition, @sponsor = sponsor.petition, sponsor @sponsor_count = @petition.sponsor_count @@ -37,10 +39,15 @@ def subject_for(key, options = {}) def i18n_options {}.tap do |options| options[:scope] = :"petitions.emails.subjects" + options[:threshold] = number_to_word(Site.threshold_for_moderation) if defined?(@sponsor) options[:name] = @sponsor.name end + + if defined?(@petition) + options[:action] = @petition.action + end end end end diff --git a/app/views/archived/petition_mailer/notify_creator_of_debate_scheduled.html.erb b/app/views/archived/petition_mailer/notify_creator_of_debate_scheduled.html.erb index faa357842..0f8c6ccd6 100644 --- a/app/views/archived/petition_mailer/notify_creator_of_debate_scheduled.html.erb +++ b/app/views/archived/petition_mailer/notify_creator_of_debate_scheduled.html.erb @@ -1,13 +1,23 @@ <%= render "reason" %>

Dear <%= @signature.name %>,

-

Parliament is going to debate your petition – “<%= @petition.action %>”.

- -

<%= link_to nil, archived_petition_url(@petition) %>

+

MPs are going to debate your petition – “<%= link_to @petition.action, archived_petition_url(@petition) %>”.

The debate is scheduled for <%= short_date_format(@petition.scheduled_debate_date) %>.

-

Once the debate has happened, we’ll email you a video and transcript.

+

You can watch the debate live on Youtube or parliamentlive.tv.

+ +

You can read a transcript of the debate a few hours after it ends.

+ +

After the debate, we’ll email you a video and transcript.

+ +

Petition debates

+ +

Petition debates allow MPs from all parties to discuss the issues raised by petitions.

+ +

They don’t end with a vote to implement the request of a petition.

+ +

Find out more

<%= render "footer" %> <%= render "unsubscribe" %> diff --git a/app/views/archived/petition_mailer/notify_creator_of_debate_scheduled.text.erb b/app/views/archived/petition_mailer/notify_creator_of_debate_scheduled.text.erb index d5bd2867e..a22e4d76c 100644 --- a/app/views/archived/petition_mailer/notify_creator_of_debate_scheduled.text.erb +++ b/app/views/archived/petition_mailer/notify_creator_of_debate_scheduled.text.erb @@ -1,13 +1,28 @@ <%= render "reason" %> Dear <%= @signature.name %>, -Parliament is going to debate your petition – “<%= @petition.action %>”. - -<%= archived_petition_url(@petition) %> +MPs are going to debate your petition – “<%= @petition.action %>”. The debate is scheduled for <%= short_date_format(@petition.scheduled_debate_date) %>. -Once the debate has happened, we’ll email you a video and transcript. +You can watch the debate live on [Youtube][1] or [parliamentlive.tv][2]. + +You can read a [transcript of the debate][3] a few hours after it ends. + +After the debate, we’ll email you a video and transcript. + +### Petition debates + +Petition debates allow MPs from all parties to discuss the issues raised by petitions. + +They don’t end with a vote to implement the request of a petition. + +[Find out more][4] + +[1]: http://www.youtube.com/ukparliament +[2]: https://parliamentlive.tv/Commons +[3]: https://hansard.parliament.uk/ +[4]: https://committees.parliament.uk/committee/326/petitions-committee/content/194347/how-petitions-debates-work/ <%= render "footer" %> <%= render "unsubscribe" %> diff --git a/app/views/archived/petition_mailer/notify_creator_of_threshold_response.html.erb b/app/views/archived/petition_mailer/notify_creator_of_threshold_response.html.erb index fdf8e2f02..f861d25e9 100644 --- a/app/views/archived/petition_mailer/notify_creator_of_threshold_response.html.erb +++ b/app/views/archived/petition_mailer/notify_creator_of_threshold_response.html.erb @@ -1,25 +1,13 @@ <%= render "reason" %>

Dear <%= @signature.name %>,

-

The Government has responded to your petition – “<%= link_to @petition.action, archived_petition_url(@petition) %>”.

- -

Government responded:

+The <%= link_to "Government has responded", archived_petition_url(@petition, reveal_response: "yes") %> to your petition: “<%= @petition.action %>”.
<%= auto_link(simple_format(h(@government_response.summary))) %>
<%= auto_link(simple_format(h(@government_response.details))) %>
-

Click this link to view the response online:

- -

<%= link_to nil, archived_petition_url(@petition, reveal_response: "yes") %>

- -<% if @petition.signature_count < @parliament.threshold_for_debate %> -

The Petitions Committee will take a look at this petition and its response. They can press the government for action and gather evidence. If this petition reaches <%= @parliament.formatted_threshold_for_debate %> signatures, the Committee will consider it for a debate.

-<% else %> -

This petition has over <%= @parliament.formatted_threshold_for_debate %> signatures. The Petitions Committee will consider it for a debate. They can also gather further evidence and press the government for action.

-<% end %> - -

The Committee is made up of 11 MPs, from political parties in government and in opposition. It is entirely independent of the Government. Find out more about the Committee: <%= link_to nil, help_url(anchor: 'petitions-committee') %>

+

If it reaches <%= Site.formatted_threshold_for_debate %> signatures, the Petitions Committee will consider whether MPs debate it in the House of Commons.

<%= render "footer" %> <%= render "unsubscribe" %> diff --git a/app/views/archived/petition_mailer/notify_creator_of_threshold_response.text.erb b/app/views/archived/petition_mailer/notify_creator_of_threshold_response.text.erb index 92a71790c..6565bdbfa 100644 --- a/app/views/archived/petition_mailer/notify_creator_of_threshold_response.text.erb +++ b/app/views/archived/petition_mailer/notify_creator_of_threshold_response.text.erb @@ -1,25 +1,14 @@ <%= render "reason" %> Dear <%= @signature.name %>, -The Government has responded to your petition – “<%= @petition.action %>”. - -Government responded: +The Government has responded to your petition: “<%= @petition.action %>”. +<%= archived_petition_url(@petition, reveal_response: "yes") %> <%= h(@government_response.summary) %> <%= h(@government_response.details) %> -Click this link to view the response online: - -<%= archived_petition_url(@petition, reveal_response: "yes") %> - -<% if @petition.signature_count < Site.threshold_for_debate %> -The Petitions Committee will take a look at this petition and its response. They can press the government for action and gather evidence. If this petition reaches <%= Site.formatted_threshold_for_debate %> signatures, the Committee will consider it for a debate. -<% else %> -This petition has over <%= Site.formatted_threshold_for_debate %> signatures. The Petitions Committee will consider it for a debate. They can also gather further evidence and press the government for action. -<% end %> - -The Committee is made up of 11 MPs, from political parties in government and in opposition. It is entirely independent of the Government. Find out more about the Committee: <%= help_url(anchor: 'petitions-committee') %> +If it reaches <%= Site.formatted_threshold_for_debate %> signatures, the Petitions Committee will consider whether MPs debate it in the House of Commons. <%= render "footer" %> <%= render "unsubscribe" %> diff --git a/app/views/archived/petition_mailer/notify_signer_of_debate_scheduled.html.erb b/app/views/archived/petition_mailer/notify_signer_of_debate_scheduled.html.erb index 1a1593171..addcf6b27 100644 --- a/app/views/archived/petition_mailer/notify_signer_of_debate_scheduled.html.erb +++ b/app/views/archived/petition_mailer/notify_signer_of_debate_scheduled.html.erb @@ -1,13 +1,23 @@ <%= render "reason" %>

Dear <%= @signature.name %>,

-

Parliament is going to debate the petition you signed – “<%= @petition.action %>”.

- -

<%= link_to nil, archived_petition_url(@petition) %>

+

MPs are going to debate the petition you signed: “<%= link_to @petition.action, archived_petition_url(@petition) %>”.

The debate is scheduled for <%= short_date_format(@petition.scheduled_debate_date) %>.

-

Once the debate has happened, we’ll email you a video and transcript.

+

You can watch the debate live on Youtube or parliamentlive.tv.

+ +

You can read a transcript of the debate a few hours after it ends.

+ +

After the debate, we’ll email you a video and transcript.

+ +

Petition debates

+ +

Petition debates allow MPs from all parties to discuss the issues raised by petitions.

+ +

They don’t end with a vote to implement the request of a petition.

+ +

Find out more

<%= render "footer" %> <%= render "unsubscribe" %> diff --git a/app/views/archived/petition_mailer/notify_signer_of_debate_scheduled.text.erb b/app/views/archived/petition_mailer/notify_signer_of_debate_scheduled.text.erb index eda043605..1d57cfe7f 100644 --- a/app/views/archived/petition_mailer/notify_signer_of_debate_scheduled.text.erb +++ b/app/views/archived/petition_mailer/notify_signer_of_debate_scheduled.text.erb @@ -1,13 +1,28 @@ <%= render "reason" %> Dear <%= @signature.name %>, -Parliament is going to debate the petition you signed – “<%= @petition.action %>”. - -<%= archived_petition_url(@petition) %> +MPs are going to debate the petition you signed: “<%= @petition.action %>”. The debate is scheduled for <%= short_date_format(@petition.scheduled_debate_date) %>. -Once the debate has happened, we’ll email you a video and transcript. +You can watch the debate live on [Youtube][1] or [parliamentlive.tv][2]. + +You can read a [transcript of the debate][3] a few hours after it ends. + +After the debate, we’ll email you a video and transcript. + +### Petition debates + +Petition debates allow MPs from all parties to discuss the issues raised by petitions. + +They don’t end with a vote to implement the request of a petition. + +[Find out more][4] + +[1]: http://www.youtube.com/ukparliament +[2]: https://parliamentlive.tv/Commons +[3]: https://hansard.parliament.uk/ +[4]: https://committees.parliament.uk/committee/326/petitions-committee/content/194347/how-petitions-debates-work/ <%= render "footer" %> <%= render "unsubscribe" %> diff --git a/app/views/archived/petition_mailer/notify_signer_of_threshold_response.html.erb b/app/views/archived/petition_mailer/notify_signer_of_threshold_response.html.erb index 57957c1f7..794cdb0e1 100644 --- a/app/views/archived/petition_mailer/notify_signer_of_threshold_response.html.erb +++ b/app/views/archived/petition_mailer/notify_signer_of_threshold_response.html.erb @@ -1,25 +1,13 @@ <%= render "reason" %>

Dear <%= @signature.name %>,

-

The Government has responded to the petition you signed – “<%= link_to @petition.action, archived_petition_url(@petition) %>”.

- -

Government responded:

+

The Government has responded to the petition you signed.

<%= auto_link(simple_format(h(@government_response.summary))) %>
-
<%= auto_link(simple_format(h(@government_response.details))) %>
- -

Click this link to view the response online:

- -

<%= link_to nil, archived_petition_url(@petition, reveal_response: "yes") %>

- -<% if @petition.signature_count < @parliament.threshold_for_debate %> -

The Petitions Committee will take a look at this petition and its response. They can press the government for action and gather evidence. If this petition reaches <%= @parliament.formatted_threshold_for_debate %> signatures, the Committee will consider it for a debate.

-<% else %> -

This petition has over <%= @parliament.formatted_threshold_for_debate %> signatures. The Petitions Committee will consider it for a debate. They can also gather further evidence and press the government for action.

-<% end %> +

<%= link_to "Read the full response", archived_petition_url(@petition, reveal_response: "yes") %>.

-

The Committee is made up of 11 MPs, from political parties in government and in opposition. It is entirely independent of the Government. Find out more about the Committee: <%= link_to nil, help_url(anchor: 'petitions-committee') %>

+

If <%= Site.formatted_threshold_for_debate %> people sign the petition, the Petitions Committee will consider whether MPs debate it in Parliament.

<%= render "footer" %> <%= render "unsubscribe" %> diff --git a/app/views/archived/petition_mailer/notify_signer_of_threshold_response.text.erb b/app/views/archived/petition_mailer/notify_signer_of_threshold_response.text.erb index 65b0f2c39..c3997607a 100644 --- a/app/views/archived/petition_mailer/notify_signer_of_threshold_response.text.erb +++ b/app/views/archived/petition_mailer/notify_signer_of_threshold_response.text.erb @@ -1,25 +1,14 @@ <%= render "reason" %> Dear <%= @signature.name %>, -The Government has responded to the petition you signed – “<%= @petition.action %>”. - -Government responded: +The Government has responded to the petition you signed. <%= h(@government_response.summary) %> -<%= h(@government_response.details) %> - -Click this link to view the response online: - +Read the full response: <%= archived_petition_url(@petition, reveal_response: "yes") %> -<% if @petition.signature_count < @parliament.threshold_for_debate %> -The Petitions Committee will take a look at this petition and its response. They can press the government for action and gather evidence. If this petition reaches <%= @parliament.formatted_threshold_for_debate %> signatures, the Committee will consider it for a debate. -<% else %> -This petition has over <%= @parliament.formatted_threshold_for_debate %> signatures. The Petitions Committee will consider it for a debate. They can also gather further evidence and press the government for action. -<% end %> - -The Committee is made up of 11 MPs, from political parties in government and in opposition. It is entirely independent of the Government. Find out more about the Committee: <%= help_url(anchor: 'petitions-committee') %> +If <%= Site.formatted_threshold_for_debate %> people sign the petition, the Petitions Committee will consider whether MPs debate it in Parliament. <%= render "footer" %> <%= render "unsubscribe" %> diff --git a/app/views/layouts/default_mail.html.erb b/app/views/layouts/default_mail.html.erb index 41d4e2ce5..3caf191ac 100644 --- a/app/views/layouts/default_mail.html.erb +++ b/app/views/layouts/default_mail.html.erb @@ -2,11 +2,39 @@ @@ -37,4 +65,3 @@ - diff --git a/app/views/petition_mailer/email_confirmation_for_signer.html.erb b/app/views/petition_mailer/email_confirmation_for_signer.html.erb index 210735c86..f5ba7b06f 100644 --- a/app/views/petition_mailer/email_confirmation_for_signer.html.erb +++ b/app/views/petition_mailer/email_confirmation_for_signer.html.erb @@ -1,5 +1,5 @@ -

Click this link to sign the petition "<%= @petition.action %>"

+

Dear <%= @signature.name %>,

-

<%= link_to nil, verify_signature_url(@signature, token: @signature.perishable_token) %>

+

Please <%= link_to "confirm your email", verify_signature_url(@signature, token: @signature.perishable_token) %> to sign the petition: “<%= link_to @petition.action, petition_url(@petition) %>”.

<%= render "footer" %> diff --git a/app/views/petition_mailer/email_confirmation_for_signer.text.erb b/app/views/petition_mailer/email_confirmation_for_signer.text.erb index d5f6d960f..08568f392 100644 --- a/app/views/petition_mailer/email_confirmation_for_signer.text.erb +++ b/app/views/petition_mailer/email_confirmation_for_signer.text.erb @@ -1,5 +1,9 @@ -Click this link to sign the petition "<%= @petition.action %>" +Dear <%= @signature.name %>, +Please confirm your email: <%= verify_signature_url(@signature, token: @signature.perishable_token) %> +to sign the petition “<%= @petition.action %>”: +<%= petition_url(@petition) %> + <%= render "footer" %> diff --git a/app/views/petition_mailer/email_duplicate_signatures.html.erb b/app/views/petition_mailer/email_duplicate_signatures.html.erb index 405fcc83d..d8d842c88 100644 --- a/app/views/petition_mailer/email_duplicate_signatures.html.erb +++ b/app/views/petition_mailer/email_duplicate_signatures.html.erb @@ -1,6 +1,7 @@ -

You're receiving this email because your email has been used to sign the petition “<%= @petition.action %>”, but you have already signed this petition.

+

Dear <%= @signature.name %>,

-

View the petition “<%= @petition.action %>” at:
-<%= link_to nil, petition_url(@petition) %>

+

Your email has been used to sign the petition: “<%= link_to @petition.action, petition_url(@petition) %>”.

+ +

You have already signed it, so your signature cannot be accepted.

<%= render "footer" %> diff --git a/app/views/petition_mailer/email_duplicate_signatures.text.erb b/app/views/petition_mailer/email_duplicate_signatures.text.erb index 998a6e25f..9bcdd6e18 100644 --- a/app/views/petition_mailer/email_duplicate_signatures.text.erb +++ b/app/views/petition_mailer/email_duplicate_signatures.text.erb @@ -1,6 +1,8 @@ -You're receiving this email because your email has been used to sign the petition “<%= @petition.action %>”, but you have already signed this petition. +Dear <%= @signature.name %>, -View the petition “<%= @petition.action %>” at: +Your email has been used to sign the petition “<%= @petition.action %>": <%= petition_url(@petition) %> +You have already signed it, so your signature cannot be accepted. + <%= render "footer" %> diff --git a/app/views/petition_mailer/gather_sponsors_for_petition.html.erb b/app/views/petition_mailer/gather_sponsors_for_petition.html.erb index a4f0cf524..666875d19 100644 --- a/app/views/petition_mailer/gather_sponsors_for_petition.html.erb +++ b/app/views/petition_mailer/gather_sponsors_for_petition.html.erb @@ -1,33 +1,26 @@ +

You’re receiving this email because you created the petition: “<%= link_to @petition.action, new_petition_sponsor_url(@petition, token: @petition.sponsor_token) %>”.

+

Dear <%= @creator.name %>,

You’re not done yet!

-

Forward the email below to your potential supporters.

+

<%= number_to_word(Site.threshold_for_moderation).titleize %> people need to sign your petition for us to check it.

-

<%= Site.threshold_for_moderation %> people need to click the link and confirm their support for us to check your petition.

+

Share <%= link_to "your petition", new_petition_sponsor_url(@petition, token: @petition.sponsor_token) %> with your potential supporters, or send them the information at the bottom of this email.

-<% if moderation_delay? %> -

Once you’ve gained the required number of supporters, we’ll check your petition to make sure it meets the petition standards. If it does, we’ll publish it. <%= moderation_delay_message %>

-<% elsif christmas_period? %> -

Once you’ve gained the required number of supporters, we’ll check your petition to make sure it meets the petition standards. If it does, we’ll publish it. This usually takes a week or less but over the Christmas period it will take us a little longer than usual. We’ll check your petition as quickly as we can.

-<% elsif easter_period? %> -

Once you’ve gained the required number of supporters, we’ll check your petition to make sure it meets the petition standards. If it does, we’ll publish it. This usually takes a week or less but over the Easter period it will take us a little longer than usual. We’ll check your petition as quickly as we can.

-<% else %> -

Once you’ve gained the required number of supporters, we’ll check your petition to make sure it meets the petition standards. If it does, we’ll publish it. This usually takes a week or less.

-<% end %> +

Once you’ve gained <%= number_to_word(Site.threshold_for_moderation) %> signatures, we’ll check your petition to make sure it meets the <%= link_to "petition standards", help_url(anchor: 'standards') %>. If it does, we’ll publish it. If it doesn’t, we’ll let you know why.

-

Once your petition has <%= Site.maximum_number_of_signatures %> signatures it won’t be able to add more until it’s been checked by the petitions team. So, please wait until it’s been checked and published before sharing it more widely.

+

This can take up to 10 working days. Thank you for your patience.

-<%= render "footer" %> +

Up to <%= Site.maximum_number_of_sponsors %> people can sign your petition while we are checking it. Please wait until it’s been checked and published before sharing it more widely.

-
+<%= render "footer" %> -

I’ve made a petition – will you sign it?

+
-

Click this link to sign the petition:
-<%= link_to nil, new_petition_sponsor_url(@petition, token: @petition.sponsor_token) %>

+

I want to start a petition – will you sign it?

-

My petition:

+

<%= link_to "Sign the petition", new_petition_sponsor_url(@petition, token: @petition.sponsor_token) %>

<%= @petition.action %>

@@ -37,7 +30,4 @@

<%= @petition.additional_details %>

<% end %> -
- -

Click this link to sign the petition:
-<%= link_to nil, new_petition_sponsor_url(@petition, token: @petition.sponsor_token) %>

+

<%= link_to "Sign the petition", new_petition_sponsor_url(@petition, token: @petition.sponsor_token) %>

diff --git a/app/views/petition_mailer/gather_sponsors_for_petition.text.erb b/app/views/petition_mailer/gather_sponsors_for_petition.text.erb index 96d29db36..621886d5e 100644 --- a/app/views/petition_mailer/gather_sponsors_for_petition.text.erb +++ b/app/views/petition_mailer/gather_sponsors_for_petition.text.erb @@ -1,34 +1,31 @@ +You’re receiving this email because you created the petition: “<%= @petition.action %>”. +<%= new_petition_sponsor_url(@petition, token: @petition.sponsor_token) %> + +-- + Dear <%= @creator.name %>, You’re not done yet! -Forward the email below to your potential supporters. +<%= number_to_word(Site.threshold_for_moderation).titleize %> people need to sign your petition for us to check it. -<%= Site.threshold_for_moderation %> people need to click the link and confirm their support for us to check your petition. +Share your petition with your potential supporters, or send them the information at the bottom of this email. +<%= new_petition_sponsor_url(@petition, token: @petition.sponsor_token) %> -<% if moderation_delay? %> -Once you’ve gained the required number of supporters, we’ll check your petition to make sure it meets the petition standards. If it does, we’ll publish it. <%= moderation_delay_message %> -<% elsif christmas_period? %> -Once you’ve gained the required number of supporters, we’ll check your petition to make sure it meets the petition standards. If it does, we’ll publish it. This usually takes a week or less but over the Christmas period it will take us a little longer than usual. We’ll check your petition as quickly as we can. -<% elsif easter_period? %> -Once you’ve gained the required number of supporters, we’ll check your petition to make sure it meets the petition standards. If it does, we’ll publish it. This usually takes a week or less but over the Easter period it will take us a little longer than usual. We’ll check your petition as quickly as we can. -<% else %> -Once you’ve gained the required number of supporters, we’ll check your petition to make sure it meets the petition standards. If it does, we’ll publish it. This usually takes a week or less. -<% end %> +Once you’ve gained <%= number_to_word(Site.threshold_for_moderation) %> signatures, we’ll check your petition to make sure it meets the petition standards. If it does, we’ll publish it. If it doesn’t, we’ll let you know why. -Once your petition has <%= Site.maximum_number_of_signatures %> signatures it won’t be able to add more until it’s been checked by the petitions team. So, please wait until it’s been checked and published before sharing it more widely. +This can take up to 10 working days. Thank you for your patience. -<%= render "footer" %> +Up to <%= Site.maximum_number_of_sponsors %> people can sign your petition while we are checking it. Please wait until it’s been checked and published before sharing it more widely. +<%= render "footer" %> -- -I've made a petition – will you sign it? +I want to start a petition – will you sign it? -Click this link to sign the petition: +Sign the petition: <%= new_petition_sponsor_url(@petition, token: @petition.sponsor_token) %> -My petition: - <%= @petition.action %> <%= @petition.background %> @@ -37,7 +34,5 @@ My petition: <%= @petition.additional_details %> <% end %> --- - -Click this link to sign the petition: +Sign the petition: <%= new_petition_sponsor_url(@petition, token: @petition.sponsor_token) %> diff --git a/app/views/petition_mailer/notify_creator_of_debate_scheduled.html.erb b/app/views/petition_mailer/notify_creator_of_debate_scheduled.html.erb index ef926c9ed..896b5f8b6 100644 --- a/app/views/petition_mailer/notify_creator_of_debate_scheduled.html.erb +++ b/app/views/petition_mailer/notify_creator_of_debate_scheduled.html.erb @@ -1,13 +1,23 @@ <%= render "reason" %>

Dear <%= @signature.name %>,

-

Parliament is going to debate your petition – “<%= @petition.action %>”.

- -

<%= link_to nil, petition_url(@petition) %>

+

MPs are going to debate your petition – “<%= link_to @petition.action, petition_url(@petition) %>”.

The debate is scheduled for <%= short_date_format(@petition.scheduled_debate_date) %>.

-

Once the debate has happened, we’ll email you a video and transcript.

+

You can watch the debate live on Youtube or parliamentlive.tv.

+ +

You can read a transcript of the debate a few hours after it ends.

+ +

After the debate, we’ll email you a video and transcript.

+ +

Petition debates

+ +

Petition debates allow MPs from all parties to discuss the issues raised by petitions.

+ +

They don’t end with a vote to implement the request of a petition.

+ +

Find out more

<%= render "footer" %> <%= render "unsubscribe" %> diff --git a/app/views/petition_mailer/notify_creator_of_debate_scheduled.text.erb b/app/views/petition_mailer/notify_creator_of_debate_scheduled.text.erb index 3a5662c89..a22e4d76c 100644 --- a/app/views/petition_mailer/notify_creator_of_debate_scheduled.text.erb +++ b/app/views/petition_mailer/notify_creator_of_debate_scheduled.text.erb @@ -1,13 +1,28 @@ <%= render "reason" %> Dear <%= @signature.name %>, -Parliament is going to debate your petition – “<%= @petition.action %>”. - -<%= petition_url(@petition) %> +MPs are going to debate your petition – “<%= @petition.action %>”. The debate is scheduled for <%= short_date_format(@petition.scheduled_debate_date) %>. -Once the debate has happened, we’ll email you a video and transcript. +You can watch the debate live on [Youtube][1] or [parliamentlive.tv][2]. + +You can read a [transcript of the debate][3] a few hours after it ends. + +After the debate, we’ll email you a video and transcript. + +### Petition debates + +Petition debates allow MPs from all parties to discuss the issues raised by petitions. + +They don’t end with a vote to implement the request of a petition. + +[Find out more][4] + +[1]: http://www.youtube.com/ukparliament +[2]: https://parliamentlive.tv/Commons +[3]: https://hansard.parliament.uk/ +[4]: https://committees.parliament.uk/committee/326/petitions-committee/content/194347/how-petitions-debates-work/ <%= render "footer" %> <%= render "unsubscribe" %> diff --git a/app/views/petition_mailer/notify_creator_of_threshold_response.html.erb b/app/views/petition_mailer/notify_creator_of_threshold_response.html.erb index 5a5da96e9..14c5b7cf0 100644 --- a/app/views/petition_mailer/notify_creator_of_threshold_response.html.erb +++ b/app/views/petition_mailer/notify_creator_of_threshold_response.html.erb @@ -1,25 +1,13 @@ <%= render "reason" %>

Dear <%= @signature.name %>,

-

The Government has responded to your petition – “<%= link_to @petition.action, petition_url(@petition) %>”.

- -

Government responded:

+The <%= link_to "Government has responded", petition_url(@petition, reveal_response: "yes") %> to your petition: “<%= @petition.action %>”.
<%= auto_link(simple_format(h(@government_response.summary))) %>
<%= auto_link(simple_format(h(@government_response.details))) %>
-

Click this link to view the response online:

- -

<%= link_to nil, petition_url(@petition, reveal_response: "yes") %>

- -<% if @petition.signature_count < Site.threshold_for_debate %> -

The Petitions Committee will take a look at this petition and its response. They can press the government for action and gather evidence. If this petition reaches <%= Site.formatted_threshold_for_debate %> signatures, the Committee will consider it for a debate.

-<% else %> -

This petition has over <%= Site.formatted_threshold_for_debate %> signatures. The Petitions Committee will consider it for a debate. They can also gather further evidence and press the government for action.

-<% end %> - -

The Committee is made up of 11 MPs, from political parties in government and in opposition. It is entirely independent of the Government. Find out more about the Committee: <%= link_to nil, help_url(anchor: 'petitions-committee') %>

+

If it reaches <%= Site.formatted_threshold_for_debate %> signatures, the Petitions Committee will consider whether MPs debate it in the House of Commons.

<%= render "footer" %> <%= render "unsubscribe" %> diff --git a/app/views/petition_mailer/notify_creator_of_threshold_response.text.erb b/app/views/petition_mailer/notify_creator_of_threshold_response.text.erb index 4deb5e338..05827c6df 100644 --- a/app/views/petition_mailer/notify_creator_of_threshold_response.text.erb +++ b/app/views/petition_mailer/notify_creator_of_threshold_response.text.erb @@ -1,25 +1,14 @@ <%= render "reason" %> Dear <%= @signature.name %>, -The Government has responded to your petition – “<%= @petition.action %>”. - -Government responded: +The Government has responded to your petition: “<%= @petition.action %>”. +<%= petition_url(@petition, reveal_response: "yes") %> <%= h(@government_response.summary) %> <%= h(@government_response.details) %> -Click this link to view the response online: - -<%= petition_url(@petition, reveal_response: "yes") %> - -<% if @petition.signature_count < Site.threshold_for_debate %> -The Petitions Committee will take a look at this petition and its response. They can press the government for action and gather evidence. If this petition reaches <%= Site.formatted_threshold_for_debate %> signatures, the Committee will consider it for a debate. -<% else %> -This petition has over <%= Site.formatted_threshold_for_debate %> signatures. The Petitions Committee will consider it for a debate. They can also gather further evidence and press the government for action. -<% end %> - -The Committee is made up of 11 MPs, from political parties in government and in opposition. It is entirely independent of the Government. Find out more about the Committee: <%= help_url(anchor: 'petitions-committee') %> +If it reaches <%= Site.formatted_threshold_for_debate %> signatures, the Petitions Committee will consider whether MPs debate it in the House of Commons. <%= render "footer" %> <%= render "unsubscribe" %> diff --git a/app/views/petition_mailer/notify_creator_that_petition_is_published.html.erb b/app/views/petition_mailer/notify_creator_that_petition_is_published.html.erb index 14dbbfa26..b5fb910e8 100644 --- a/app/views/petition_mailer/notify_creator_that_petition_is_published.html.erb +++ b/app/views/petition_mailer/notify_creator_that_petition_is_published.html.erb @@ -1,8 +1,22 @@

Dear <%= @signature.name %>,

-

We published the petition you created – “<%= @petition.action %>”

+

We published the petition you created: “<%= link_to @petition.action, petition_url(@petition) %>”.

-

Click this link to see your petition and start sharing it:
-<%= link_to nil, petition_url(@petition) %>

+

<%= link_to "View the petition", petition_url(@petition) %>

+ +

It will be open for six months.

+ +

If 10,000 people sign this petition, the Government will respond.

+ +

If 100,000 people sign it, the Petitions Committee will consider whether MPs debate it in Parliament.

+ +

If you chose to receive updates about this petition, we’ll tell you if it receives a government response or will be debated.

+ +

We may also update you:

+ + <%= render "footer" %> diff --git a/app/views/petition_mailer/notify_creator_that_petition_is_published.text.erb b/app/views/petition_mailer/notify_creator_that_petition_is_published.text.erb index 6dc6d0349..a977493da 100644 --- a/app/views/petition_mailer/notify_creator_that_petition_is_published.text.erb +++ b/app/views/petition_mailer/notify_creator_that_petition_is_published.text.erb @@ -1,8 +1,22 @@ Dear <%= @signature.name %>, -We published the petition you created – “<%= @petition.action %>”. +We published the petition you created: “<%= @petition.action %>”. -Click this link to see your petition and start sharing it: +View the petition: <%= petition_url(@petition) %> +It will be open for six months. + +If 10,000 people sign this petition, the Government will respond. + +If 100,000 people sign it, the Petitions Committee will consider whether MPs debate it in Parliament. + +If you chose to receive updates about this petition, we’ll tell you if it receives a government response or will be debated. + +We may also update you: + +* if the topic is raised elsewhere in Parliament + +* about any opportunities to share your views of the topic with MPs or the Government. + <%= render "footer" %> diff --git a/app/views/petition_mailer/notify_creator_that_petition_was_rejected.html.erb b/app/views/petition_mailer/notify_creator_that_petition_was_rejected.html.erb index ddd72a93b..63c59876d 100644 --- a/app/views/petition_mailer/notify_creator_that_petition_was_rejected.html.erb +++ b/app/views/petition_mailer/notify_creator_that_petition_was_rejected.html.erb @@ -1,22 +1,21 @@

Dear <%= @signature.name %>,

-

Sorry, we can’t accept your petition – “<%= @petition.action %>”. +<% if @petition.hidden? %> +

Sorry, we can’t accept your petition – “<%= @petition.action %>”.

+<% else %> +

Sorry, we can’t accept your petition – “<%= link_to @petition.action, petition_url(@petition) %>”.

+<% end %> <%= rejection_description(@rejection.code) %> <% if @rejection.details? -%>

<%= auto_link(h(@rejection.details)) %>

<% end -%> -<% unless @petition.hidden? -%> -

Click this link to see your rejected petition:
-<%= link_to 'View your rejected petition', petition_url(@petition) %>

-<% end -%> +

We can only accept petitions that meet the petition standards.

-

We only reject petitions that don’t meet the petition standards:
-<%= link_to nil, help_url(anchor: 'standards') %>

+

If you like, you can <%= link_to "start a new petition", check_petitions_url %>.

-

If you want to try again, click here to start a petition:
-<%= link_to nil, check_petitions_url %>

+

We understand that it can be disappointing when your petition cannot be accepted. There are also other ways to raise issues in Parliament.

<%= render "footer" %> diff --git a/app/views/petition_mailer/notify_creator_that_petition_was_rejected.text.erb b/app/views/petition_mailer/notify_creator_that_petition_was_rejected.text.erb index 436fd465b..8478cef96 100644 --- a/app/views/petition_mailer/notify_creator_that_petition_was_rejected.text.erb +++ b/app/views/petition_mailer/notify_creator_that_petition_was_rejected.text.erb @@ -1,22 +1,22 @@ Dear <%= @signature.name %>, -Sorry, we can’t accept your petition – "<%= @petition.action %>". - -<%= strip_tags(rejection_description(@rejection.code)) %> -<% if @rejection.details? -%> - -<%= @rejection.details %> -<% end -%> +Sorry, we can’t accept your petition – “<%= @petition.action %>”. <% unless @petition.hidden? -%> - -Click this link to see your rejected petition: <%= petition_url(@petition) %> <% end -%> -We only reject petitions that don’t meet the petition standards: -<%= help_url(anchor: 'standards') %> +<%= strip_tags(rejection_description(@rejection.code)) %> +<% if @rejection.details? %> -If you want to try again, click here to start a petition: +<%= @rejection.details %> +<% end %> +We can only accept petitions that meet the petition standards. + +If you like, you can start a new petition: <%= check_petitions_url %> +We understand that it can be disappointing when your petition cannot be accepted. +There are also other ways to raise issues in Parliament: +https://www.parliament.uk/get-involved/ + <%= render "footer" %> diff --git a/app/views/petition_mailer/notify_signer_of_debate_scheduled.html.erb b/app/views/petition_mailer/notify_signer_of_debate_scheduled.html.erb index d2932f293..28598e81f 100644 --- a/app/views/petition_mailer/notify_signer_of_debate_scheduled.html.erb +++ b/app/views/petition_mailer/notify_signer_of_debate_scheduled.html.erb @@ -1,13 +1,23 @@ <%= render "reason" %>

Dear <%= @signature.name %>,

-

Parliament is going to debate the petition you signed – “<%= @petition.action %>”.

- -

<%= link_to nil, petition_url(@petition) %>

+

MPs are going to debate the petition you signed: “<%= link_to @petition.action, petition_url(@petition) %>”.

The debate is scheduled for <%= short_date_format(@petition.scheduled_debate_date) %>.

-

Once the debate has happened, we’ll email you a video and transcript.

+

You can watch the debate live on Youtube or parliamentlive.tv.

+ +

You can read a transcript of the debate a few hours after it ends.

+ +

After the debate, we’ll email you a video and transcript.

+ +

Petition debates

+ +

Petition debates allow MPs from all parties to discuss the issues raised by petitions.

+ +

They don’t end with a vote to implement the request of a petition.

+ +

Find out more

<%= render "footer" %> <%= render "unsubscribe" %> diff --git a/app/views/petition_mailer/notify_signer_of_debate_scheduled.text.erb b/app/views/petition_mailer/notify_signer_of_debate_scheduled.text.erb index 9f9ddc099..1d57cfe7f 100644 --- a/app/views/petition_mailer/notify_signer_of_debate_scheduled.text.erb +++ b/app/views/petition_mailer/notify_signer_of_debate_scheduled.text.erb @@ -1,13 +1,28 @@ <%= render "reason" %> Dear <%= @signature.name %>, -Parliament is going to debate the petition you signed – “<%= @petition.action %>”. - -<%= petition_url(@petition) %> +MPs are going to debate the petition you signed: “<%= @petition.action %>”. The debate is scheduled for <%= short_date_format(@petition.scheduled_debate_date) %>. -Once the debate has happened, we’ll email you a video and transcript. +You can watch the debate live on [Youtube][1] or [parliamentlive.tv][2]. + +You can read a [transcript of the debate][3] a few hours after it ends. + +After the debate, we’ll email you a video and transcript. + +### Petition debates + +Petition debates allow MPs from all parties to discuss the issues raised by petitions. + +They don’t end with a vote to implement the request of a petition. + +[Find out more][4] + +[1]: http://www.youtube.com/ukparliament +[2]: https://parliamentlive.tv/Commons +[3]: https://hansard.parliament.uk/ +[4]: https://committees.parliament.uk/committee/326/petitions-committee/content/194347/how-petitions-debates-work/ <%= render "footer" %> <%= render "unsubscribe" %> diff --git a/app/views/petition_mailer/notify_signer_of_threshold_response.html.erb b/app/views/petition_mailer/notify_signer_of_threshold_response.html.erb index b361f4723..937c31bac 100644 --- a/app/views/petition_mailer/notify_signer_of_threshold_response.html.erb +++ b/app/views/petition_mailer/notify_signer_of_threshold_response.html.erb @@ -1,25 +1,13 @@ <%= render "reason" %>

Dear <%= @signature.name %>,

-

The Government has responded to the petition you signed – “<%= link_to @petition.action, petition_url(@petition) %>”.

- -

Government responded:

+

The Government has responded to the petition you signed.

<%= auto_link(simple_format(h(@government_response.summary))) %>
-
<%= auto_link(simple_format(h(@government_response.details))) %>
- -

Click this link to view the response online:

- -

<%= link_to nil, petition_url(@petition, reveal_response: "yes") %>

- -<% if @petition.signature_count < Site.threshold_for_debate %> -

The Petitions Committee will take a look at this petition and its response. They can press the government for action and gather evidence. If this petition reaches <%= Site.formatted_threshold_for_debate %> signatures, the Committee will consider it for a debate.

-<% else %> -

This petition has over <%= Site.formatted_threshold_for_debate %> signatures. The Petitions Committee will consider it for a debate. They can also gather further evidence and press the government for action.

-<% end %> +

<%= link_to "Read the full response", petition_url(@petition, reveal_response: "yes") %>.

-

The Committee is made up of 11 MPs, from political parties in government and in opposition. It is entirely independent of the Government. Find out more about the Committee: <%= link_to nil, help_url(anchor: 'petitions-committee') %>

+

If <%= Site.formatted_threshold_for_debate %> people sign the petition, the Petitions Committee will consider whether MPs debate it in Parliament.

<%= render "footer" %> <%= render "unsubscribe" %> diff --git a/app/views/petition_mailer/notify_signer_of_threshold_response.text.erb b/app/views/petition_mailer/notify_signer_of_threshold_response.text.erb index fa32e31e7..4597502bc 100644 --- a/app/views/petition_mailer/notify_signer_of_threshold_response.text.erb +++ b/app/views/petition_mailer/notify_signer_of_threshold_response.text.erb @@ -1,25 +1,14 @@ <%= render "reason" %> Dear <%= @signature.name %>, -The Government has responded to the petition you signed – “<%= @petition.action %>”. - -Government responded: +The Government has responded to the petition you signed. <%= h(@government_response.summary) %> -<%= h(@government_response.details) %> - -Click this link to view the response online: - +Read the full response: <%= petition_url(@petition, reveal_response: "yes") %> -<% if @petition.signature_count < Site.threshold_for_debate %> -The Petitions Committee will take a look at this petition and its response. They can press the government for action and gather evidence. If this petition reaches <%= Site.formatted_threshold_for_debate %> signatures, the Committee will consider it for a debate. -<% else %> -This petition has over <%= Site.formatted_threshold_for_debate %> signatures. The Petitions Committee will consider it for a debate. They can also gather further evidence and press the government for action. -<% end %> - -The Committee is made up of 11 MPs, from political parties in government and in opposition. It is entirely independent of the Government. Find out more about the Committee: <%= help_url(anchor: 'petitions-committee') %> +If <%= Site.formatted_threshold_for_debate %> people sign the petition, the Petitions Committee will consider whether MPs debate it in Parliament. <%= render "footer" %> <%= render "unsubscribe" %> diff --git a/app/views/petition_mailer/notify_sponsor_that_petition_is_published.html.erb b/app/views/petition_mailer/notify_sponsor_that_petition_is_published.html.erb index 73ec3ce86..417ca35b5 100644 --- a/app/views/petition_mailer/notify_sponsor_that_petition_is_published.html.erb +++ b/app/views/petition_mailer/notify_sponsor_that_petition_is_published.html.erb @@ -1,8 +1,22 @@

Dear <%= @signature.name %>,

-

We published the petition you supported – “<%= @petition.action %>”

+

We published the petition you supported: “<%= link_to @petition.action, petition_url(@petition) %>”.

-

Click this link to see the petition and start sharing it:
-<%= link_to nil, petition_url(@petition) %>

+

It will be open for six months.

+ +

If 10,000 people sign this petition, the Government will respond.

+ +

If 100,000 people sign it, the Petitions Committee will consider whether MPs debate it in Parliament.

+ +

If you chose to receive updates about this petition, we’ll tell you if it receives a government response or will be debated.

+ +

We may also update you:

+ + + +

<%= link_to "View the petition", petition_url(@petition) %>

<%= render "footer" %> diff --git a/app/views/petition_mailer/notify_sponsor_that_petition_is_published.text.erb b/app/views/petition_mailer/notify_sponsor_that_petition_is_published.text.erb index 0266dc453..dafb93efe 100644 --- a/app/views/petition_mailer/notify_sponsor_that_petition_is_published.text.erb +++ b/app/views/petition_mailer/notify_sponsor_that_petition_is_published.text.erb @@ -1,8 +1,22 @@ Dear <%= @signature.name %>, -We published the petition you supported – “<%= @petition.action %>”. +We published the petition you supported: “<%= @petition.action %>”. -Click this link to see the petition and start sharing it: +It will be open for six months. + +If 10,000 people sign this petition, the Government will respond. + +If 100,000 people sign it, the Petitions Committee will consider whether MPs debate it in Parliament. + +If you chose to receive updates about this petition, we’ll tell you if it receives a government response or will be debated. + +We may also update you: + +* if the topic is raised elsewhere in Parliament + +* about any opportunities to share your views of the topic with MPs or the Government. + +View the petition: <%= petition_url(@petition) %> <%= render "footer" %> diff --git a/app/views/petition_mailer/notify_sponsor_that_petition_was_rejected.html.erb b/app/views/petition_mailer/notify_sponsor_that_petition_was_rejected.html.erb index c128112c1..9b5470494 100644 --- a/app/views/petition_mailer/notify_sponsor_that_petition_was_rejected.html.erb +++ b/app/views/petition_mailer/notify_sponsor_that_petition_was_rejected.html.erb @@ -1,19 +1,17 @@

Dear <%= @signature.name %>,

-

Sorry, we can’t accept the petition you supported – “<%= @petition.action %>”. +<% if @petition.hidden? %> +

Sorry, we can’t accept the petition you supported: “<%= @petition.action %>”. +<% else %> +

Sorry, we can’t accept the petition you supported: “<%= link_to @petition.action, petition_url(@petition) %>”. +<% end %> <%= rejection_description(@rejection.code) %> <% if @rejection.details? -%>

<%= auto_link(h(@rejection.details)) %>

<% end -%> -<% unless @petition.hidden? -%> -

Click this link to see the rejected petition:
-<%= link_to 'View the rejected petition', petition_url(@petition) %>

-<% end -%> - -

We only reject petitions that don’t meet the petition standards:
-<%= link_to nil, help_url(anchor: 'standards') %>

+

We only accept petitions that meet the <%= link_to "petition standards", help_url(anchor: 'standards') %>.

<%= render "footer" %> diff --git a/app/views/petition_mailer/notify_sponsor_that_petition_was_rejected.text.erb b/app/views/petition_mailer/notify_sponsor_that_petition_was_rejected.text.erb index b7f20d2bb..ce48a6cdb 100644 --- a/app/views/petition_mailer/notify_sponsor_that_petition_was_rejected.text.erb +++ b/app/views/petition_mailer/notify_sponsor_that_petition_was_rejected.text.erb @@ -1,19 +1,16 @@ Dear <%= @signature.name %>, -Sorry, we can’t accept the petition you supported – "<%= @petition.action %>". - -<%= strip_tags(rejection_description(@rejection.code)) %> -<% if @rejection.details? -%> - -<%= @rejection.details %> -<% end -%> +Sorry, we can’t accept the petition you supported: “<%= @petition.action %>”. <% unless @petition.hidden? -%> - -Click this link to see the rejected petition: <%= petition_url(@petition) %> <% end -%> -We only reject petitions that don’t meet the petition standards: +<%= strip_tags(rejection_description(@rejection.code)) %> +<% if @rejection.details? %> + +<%= @rejection.details %> +<% end %> +We only accept petitions that meet the petition standards: <%= help_url(anchor: 'standards') %> <%= render "footer" %> diff --git a/app/views/sponsor_mailer/petition_and_email_confirmation_for_sponsor.html.erb b/app/views/sponsor_mailer/petition_and_email_confirmation_for_sponsor.html.erb index 72b488a99..880b5e376 100644 --- a/app/views/sponsor_mailer/petition_and_email_confirmation_for_sponsor.html.erb +++ b/app/views/sponsor_mailer/petition_and_email_confirmation_for_sponsor.html.erb @@ -1,20 +1,15 @@ -

Click this link to sign the petition “<%= @petition.action %>”

+

Dear <%= @sponsor.name %>,

-

<%= link_to nil, verify_sponsor_url(@sponsor, token: @sponsor.perishable_token) %>

+

Please <%= link_to "confirm your email", verify_sponsor_url(@sponsor, token: @sponsor.perishable_token) %> to support and sign <%= @petition.creator.name %>’s petition:

-
- -

<%= @petition.creator.name %>’s petition:

+

<%= @petition.action %>

-

<%= @petition.background %>

<% unless @petition.additional_details.blank? %> -

<%= @petition.additional_details %>

<% end %> -
+
-

Click this link to sign the petition:
-<%= link_to nil, verify_sponsor_url(@sponsor, token: @sponsor.perishable_token) %>

+<%= render "footer" %> diff --git a/app/views/sponsor_mailer/petition_and_email_confirmation_for_sponsor.text.erb b/app/views/sponsor_mailer/petition_and_email_confirmation_for_sponsor.text.erb index 1ef0a612b..b4e829608 100644 --- a/app/views/sponsor_mailer/petition_and_email_confirmation_for_sponsor.text.erb +++ b/app/views/sponsor_mailer/petition_and_email_confirmation_for_sponsor.text.erb @@ -1,10 +1,11 @@ -Click this link to sign the petition "<%= @petition.action %>" +Dear <%= @sponsor.name %>, +Please confirm your email: <%= verify_sponsor_url(@sponsor, token: @sponsor.perishable_token) %> --- +to support and sign <%= @petition.creator.name %>’s petition: -<%= @petition.creator.name %>’s petition: +-- <%= @petition.action %> @@ -16,5 +17,4 @@ Click this link to sign the petition "<%= @petition.action %>" -- -Click this link to sign the petition: -<%= verify_sponsor_url(@sponsor, token: @sponsor.perishable_token) %> +<%= render "footer" %> diff --git a/app/views/sponsor_mailer/sponsor_signed_email_below_threshold.html.erb b/app/views/sponsor_mailer/sponsor_signed_email_below_threshold.html.erb index 78081fdab..51dd0249b 100644 --- a/app/views/sponsor_mailer/sponsor_signed_email_below_threshold.html.erb +++ b/app/views/sponsor_mailer/sponsor_signed_email_below_threshold.html.erb @@ -1,10 +1,11 @@

Dear <%= @petition.creator.name %>,

-

<%= @sponsor.name %> supported your petition – “<%= @petition.action %>”.

+

Someone supported your petition: “<%= link_to @petition.action, petition_url(@petition) %>”.

-

You have <%= pluralize(@sponsor_count, 'supporter', locale: :en) %> so far. If <%= Site.threshold_for_moderation %> people support your petition we’ll check it to make sure it meets the petition standards. If it does, we’ll publish it.

+

You have <%= pluralize(@sponsor_count, "supporter", locale: :en) %> so far.

-

Find out how we check petitions before we publish them:
-<%= link_to nil, help_url(anchor: 'standards') %>

+

If <%= number_to_word(Site.threshold_for_moderation) %> people support your petition, we’ll check it to make sure it meets the <%= link_to "petition standards", help_url(anchor: 'standards') %>. + +

If it does, we’ll publish it. If it doesn’t, we’ll let you know why.

<%= render "footer" %> diff --git a/app/views/sponsor_mailer/sponsor_signed_email_below_threshold.text.erb b/app/views/sponsor_mailer/sponsor_signed_email_below_threshold.text.erb index 9de098bc6..ff3f864fc 100644 --- a/app/views/sponsor_mailer/sponsor_signed_email_below_threshold.text.erb +++ b/app/views/sponsor_mailer/sponsor_signed_email_below_threshold.text.erb @@ -1,10 +1,13 @@ Dear <%= @petition.creator.name %>, -<%= @sponsor.name %> supported your petition – "<%= @petition.action %>". +Someone supported your petition: “<%= @petition.action %>”. +<%= petition_url(@petition) %> -You have <%= pluralize(@sponsor_count, 'supporter', locale: :en) %> so far. If <%= Site.threshold_for_moderation %> people support your petition we’ll check it to make sure it meets the petition standards. If it does, we’ll publish it. +You have <%= pluralize(@sponsor_count, "supporter", locale: :en) %> so far. -Find out how we check petitions before we publish them: +If <%= number_to_word(Site.threshold_for_moderation) %> people support your petition, we’ll check it to make sure it meets the petition standards: <%= help_url(anchor: 'standards') %> +If it does, we’ll publish it. If it doesn’t, we’ll let you know why. + <%= render "footer" %> diff --git a/app/views/sponsor_mailer/sponsor_signed_email_on_threshold.html.erb b/app/views/sponsor_mailer/sponsor_signed_email_on_threshold.html.erb index 96efca76a..eb8ecdb09 100644 --- a/app/views/sponsor_mailer/sponsor_signed_email_on_threshold.html.erb +++ b/app/views/sponsor_mailer/sponsor_signed_email_on_threshold.html.erb @@ -1,22 +1,16 @@

Dear <%= @petition.creator.name %>,

-

Your petition is nearly ready to go.

- -

<%= @sponsor.name %> supported your petition – “<%= @petition.action %>”.

+

Someone supported your petition: “<%= link_to @petition.action, petition_url(@petition) %>”.

<% if moderation_delay? %> -

<%= @sponsor_count %> people have supported your petition so far. We’re checking your petition to make sure it meets the petition standards. If it does, we’ll publish it. <%= moderation_delay_message %>

-<% elsif christmas_period? %> -

<%= @sponsor_count %> people have supported your petition so far. We’re checking your petition to make sure it meets the petition standards. If it does, we’ll publish it. This usually takes a week or less but over the Christmas period it will take us a little longer than usual. We’ll check your petition as quickly as we can.

-<% elsif easter_period? %> -

<%= @sponsor_count %> people have supported your petition so far. We’re checking your petition to make sure it meets the petition standards. If it does, we’ll publish it. This usually takes a week or less but over the Easter period it will take us a little longer than usual. We’ll check your petition as quickly as we can.

+

<%= pluralize(@sponsor_count, "person", locale: :en) %> have supported your petition. We’re checking it to make sure it meets the <%= link_to "petition standards", help_url(anchor: 'standards') %>. If it does, we’ll publish it. If it doesn’t, we’ll let you know why.

+

We currently have a very large number of petitions to check, so it may take longer than 10 working days to check your petition. Thank you for your patience.

<% else %> -

<%= @sponsor_count %> people have supported your petition so far. We’re checking your petition to make sure it meets the petition standards. If it does, we’ll publish it. This usually takes a week or less.

+

<%= pluralize(@sponsor_count, "person", locale: :en) %> have supported your petition.

+

We’re checking it to make sure it meets the <%= link_to "petition standards", help_url(anchor: 'standards') %>.

+

If it does, we’ll publish it. If it doesn’t, we’ll let you know why.

<% end %> -

Once your petition has <%= Site.maximum_number_of_signatures %> signatures it won’t be able to add more until it’s been checked. So, please wait until it’s been checked and published before sharing it with lots more people.

- -

Find out how we check petitions before we publish them:
-<%= link_to nil, help_url(anchor: 'standards') %>

+

Once your petition has <%= Site.maximum_number_of_sponsors %> supporters, no one else will be able to sign it until it’s been checked. Please wait until it’s been checked and published before sharing more widely.

<%= render "footer" %> diff --git a/app/views/sponsor_mailer/sponsor_signed_email_on_threshold.text.erb b/app/views/sponsor_mailer/sponsor_signed_email_on_threshold.text.erb index 0425cd461..3b8f85a25 100644 --- a/app/views/sponsor_mailer/sponsor_signed_email_on_threshold.text.erb +++ b/app/views/sponsor_mailer/sponsor_signed_email_on_threshold.text.erb @@ -1,22 +1,22 @@ Dear <%= @petition.creator.name %>, -Your petition is nearly ready to go. +Someone supported your petition: “[<%= @petition.action %>][1]”. -<%= @sponsor.name %> supported your petition – "<%= @petition.action %>". +<% if moderation_delay? -%> +<%= pluralize(@sponsor_count, "person", locale: :en) %> have supported your petition. We’re checking it to make sure it meets the [petition standards][2]. If it does, we’ll publish it. If it doesn’t, we’ll let you know why. -<% if moderation_delay? %> -<%= @sponsor_count %> people have supported your petition so far. We’re checking your petition to make sure it meets the petition standards. If it does, we’ll publish it. <%= moderation_delay_message %> -<% elsif christmas_period? %> -<%= @sponsor_count %> people have supported your petition so far. We’re checking your petition to make sure it meets the petition standards. If it does, we’ll publish it. This usually takes a week or less but over the Christmas period it will take us a little longer than usual. We’ll check your petition as quickly as we can. -<% elsif easter_period? %> -<%= @sponsor_count %> people have supported your petition so far. We’re checking your petition to make sure it meets the petition standards. If it does, we’ll publish it. This usually takes a week or less but over the Easter period it will take us a little longer than usual. We’ll check your petition as quickly as we can. -<% else %> -<%= @sponsor_count %> people have supported your petition so far. We’re checking your petition to make sure it meets the petition standards. If it does, we’ll publish it. This usually takes a week or less. -<% end %> +We currently have a very large number of petitions to check, so it may take longer than 10 working days to check your petition. Thank you for your patience. +<% else -%> +<%= pluralize(@sponsor_count, "person", locale: :en) %> have supported your petition. -Once your petition has <%= Site.maximum_number_of_signatures %> signatures it won’t be able to add more until it’s been checked. So, please wait until it’s been checked and published before sharing it with lots more people. +We’re checking it to make sure it meets the [petition standards][2]. -Find out how we check petitions before we publish them: -<%= help_url(anchor: 'standards') %> +If it does, we’ll publish it. If it doesn’t, we’ll let you know why. +<% end -%> + +Once your petition has <%= Site.maximum_number_of_sponsors %> supporters, no one else will be able to sign it until it’s been checked. Please wait until it’s been checked and published before sharing more widely. + +[1]: <%= petition_url(@petition) %> +[2]: <%= help_url(anchor: 'standards') %> <%= render "footer" %> diff --git a/config/locales/petitions.en-GB.yml b/config/locales/petitions.en-GB.yml index 5ee98eed5..90b737ca3 100644 --- a/config/locales/petitions.en-GB.yml +++ b/config/locales/petitions.en-GB.yml @@ -151,19 +151,19 @@ en-GB: email_signer: |- %{subject} email_confirmation_for_signer: |- - Please confirm your email address + Confirm your email to sign “%{action}” email_duplicate_signatures: |- - Duplicate signature of petition + You have tried to sign this petition twice: “%{action}” mailshot_for_signer: |- %{subject} notify_signer_of_positive_debate_outcome: |- - Parliament debated “%{action}” + MPs debated the petition “%{action}” notify_signer_of_negative_debate_outcome: |- - Parliament didn’t debate “%{action}” + MPs will not debate the petition “%{action}” notify_signer_of_debate_scheduled: |- - Parliament will debate “%{action}” + MPs will debate “%{action}” notify_signer_of_threshold_response: |- - Government responded to “%{action}” + Government response: “%{action}” # Emails to people who create petitions email_creator: |- @@ -171,13 +171,13 @@ en-GB: mailshot_for_creator: |- %{subject} notify_creator_of_positive_debate_outcome: |- - Parliament debated “%{action}” + Your petition was debated: “%{action}” notify_creator_of_negative_debate_outcome: |- - Parliament didn’t debate “%{action}” + Your petition will not be debated: “%{action}” notify_creator_of_debate_scheduled: |- - Parliament will debate “%{action}” + Debate on your petition: “%{action}” notify_creator_of_threshold_response: |- - Government responded to “%{action}” + Government response: “%{action}” notify_creator_that_moderation_is_delayed: |- %{subject} privacy_policy_update_email: |- @@ -185,35 +185,35 @@ en-GB: # Emails to people who support a petition gather_sponsors_for_petition: |- - Action required: Petition “%{action}” + Get supporters for: “%{action}” notify_creator_that_petition_is_published: |- - We published your petition “%{action}” + Your petition is live: “%{action}” notify_sponsor_that_petition_is_published: |- - We published the petition “%{action}” that you supported + We published “%{action}” notify_creator_that_petition_was_rejected: |- - We rejected your petition “%{action}” + Petition not accepted: “%{action}” notify_sponsor_that_petition_was_rejected: |- - We rejected the petition “%{action}” that you supported + Petition not accepted: “%{action}” petition_and_email_confirmation_for_sponsor: |- - Please confirm your email address + Sign to support: “%{action}” sponsor_signed_email_below_threshold: |- - %{name} supported your petition + Someone supported: “%{action}” sponsor_signed_email_on_threshold: |- - We’re checking your petition + Your petition has %{threshold} supporters: “%{action}” # Re-send confirmation emails special_resend_of_email_confirmation_for_signer: |- - Please confirm your email address + Confirm your email to sign “%{action}” notify_creator_of_closing_date_change: - one: We’re closing your petition early - other: We’re closing your petitions early + one: "General Election: your petition is closing" + other: "General Election: your petitions are closing" notify_signer_of_closing_date_change: - one: We’re closing petitions early - other: We’re closing petitions early + one: "General Election: all petitions to close" + other: "General Election: all petitions to close" notify_creator_of_sponsored_petition_being_stopped: |- - We’ve stopped your petition early + General Election: petitions website closing notify_creator_of_validated_petition_being_stopped: |- - We’ve stopped your petition early + General Election: petitions website closing signoff_prefix: "The Petitions Team" signoff_suffix: "House of Commons" diff --git a/features/laura_signs_charlies_petition_as_a_sponsor.feature b/features/laura_signs_charlies_petition_as_a_sponsor.feature index 054ac8b62..54f5e71ae 100644 --- a/features/laura_signs_charlies_petition_as_a_sponsor.feature +++ b/features/laura_signs_charlies_petition_as_a_sponsor.feature @@ -15,7 +15,7 @@ Feature: As Laura, a sponsor of my friend Charlie's petition When I say I am happy with my email address Then I should have a pending signature on the petition as a sponsor And I should receive an email explaining the petition I am sponsoring - When I confirm my email address + When I confirm my email address as a sponsor Then I should see a heading called "Thanks" And I should have fully signed the petition as a sponsor @@ -78,11 +78,11 @@ Feature: As Laura, a sponsor of my friend Charlie's petition Scenario: Laura sees notice that she has already signed when she validates more than once When I have sponsored a petition - When I confirm my email address + When I confirm my email address as a sponsor Then I should see a heading called "Thanks" And I should see "Your signature has been added to this petition as a supporter" And I should have fully signed the petition as a sponsor - When I confirm my email address again + When I confirm my email address as a sponsor again Then I should see a heading called "Thanks" And I should see "Your signature has been added to this petition as a supporter" And I should see /This petition needs [0-9]+ supporters to go live/ diff --git a/features/sam_signs_a_petition_with_suzies_email_address.feature b/features/sam_signs_a_petition_with_suzies_email_address.feature index d56008f56..0afc40289 100644 --- a/features/sam_signs_a_petition_with_suzies_email_address.feature +++ b/features/sam_signs_a_petition_with_suzies_email_address.feature @@ -13,13 +13,13 @@ Feature: Sam signs a petition Scenario: Sam cannot sign the petition again using Suzie's name When I try to sign the petition with the same email address and the same name - Then "womboid@wimbledon.com" should receive an email with subject "Duplicate signature of petition" + Then "womboid@wimbledon.com" should receive an email with subject "You have tried to sign this petition twice" Scenario: Sam cannot sign the petition with a different postcode When I try to sign the petition with the same email address, a different name, and a different postcode - Then "womboid@wimbledon.com" should receive an email with subject "Duplicate signature of petition" + Then "womboid@wimbledon.com" should receive an email with subject "You have tried to sign this petition twice" Scenario: Sarah (Sam's daughter) cannot sign the petition a third time with the same email address Given I have signed the petition with a second name When I try to sign the petition with the same email address and a third name - Then "womboid@wimbledon.com" should receive an email with subject "Duplicate signature of petition" + Then "womboid@wimbledon.com" should receive an email with subject "You have tried to sign this petition twice" diff --git a/features/step_definitions/debate_scheduled_steps.rb b/features/step_definitions/debate_scheduled_steps.rb index e7c90ef31..36223e6fb 100644 --- a/features/step_definitions/debate_scheduled_steps.rb +++ b/features/step_definitions/debate_scheduled_steps.rb @@ -3,7 +3,7 @@ steps %Q( Then "#{@petition.creator.email}" should receive an email When they open the email - Then they should see "Parliament is going to debate your petition" in the email body + Then they should see "MPs are going to debate your petition" in the email body When they click the second link in the email Then I should be on the petition page for "#{@petition.action}" ) @@ -15,7 +15,7 @@ steps %Q( Then "#{signatory.email}" should receive an email When they open the email - Then they should see "Parliament is going to debate the petition" in the email body + Then they should see "MPs are going to debate the petition" in the email body When they click the second link in the email Then I should be on the petition page for "#{@petition.action}" ) diff --git a/features/step_definitions/moderation_steps.rb b/features/step_definitions/moderation_steps.rb index 37256e133..da7842ad9 100644 --- a/features/step_definitions/moderation_steps.rb +++ b/features/step_definitions/moderation_steps.rb @@ -132,7 +132,7 @@ Then "#{@petition.creator.email}" should receive an email When they open the email Then they should see "published" in the email body - And they should see /We published your petition/ in the email subject + And they should see /Your petition is live/ in the email subject ) end @@ -147,7 +147,7 @@ When they open the email Then they should see "Sorry, we can’t accept your petition" in the email body And they should see "#{strip_tags(rejection_description(@petition.rejection.code)).split("\n").first}" in the email body - And they should see /We rejected your petition/ in the email subject + And they should see /Petition not accepted/ in the email subject ) if petition_is_libellous step %{they should not see "#{petition_url(@petition)}" in the email body} diff --git a/features/step_definitions/signature_steps.rb b/features/step_definitions/signature_steps.rb index e9c066abc..f7232a54c 100644 --- a/features/step_definitions/signature_steps.rb +++ b/features/step_definitions/signature_steps.rb @@ -22,7 +22,14 @@ When(/^I confirm my email address(?: again)?$/) do steps %Q( - And I open the email with subject "Please confirm your email address" + And I open the email with subject "Confirm your email to sign" + When I click the first link in the email + ) +end + +When(/^I confirm my email address as a sponsor(?: again)?$/) do + steps %Q( + And I open the email with subject "Sign to support:" When I click the first link in the email ) end diff --git a/features/step_definitions/sponsor_steps.rb b/features/step_definitions/sponsor_steps.rb index 7d5c4b1f8..a2084bf19 100644 --- a/features/step_definitions/sponsor_steps.rb +++ b/features/step_definitions/sponsor_steps.rb @@ -27,7 +27,7 @@ And I select "United Kingdom" from "Location" And I try to sign And I say I am happy with my email address - And "#{sponsor_email}" opens the email with subject "Please confirm your email address" + And "#{sponsor_email}" opens the email with subject "Sign to support: “#{@sponsor_petition.action}”" And they click the first link in the email } signature = @sponsor_petition.signatures.for_email(sponsor_email).first @@ -39,7 +39,7 @@ deliveries.delete_if { |email| email.to == %w[charlie.the.creator@example.com] } steps %{ - And "laura.the.sponsor@example.com" opens the email with subject "Please confirm your email address" + And "laura.the.sponsor@example.com" opens the email with subject "Sign to support: “#{@sponsor_petition.action}”" And they click the first link in the email } end @@ -146,7 +146,7 @@ expect(unread_emails_for(address).size).to eq 1 open_last_email_for(address) steps %{ - Then they should see "Please confirm your email address" in the email subject + Then they should see "Sign to support: “#{@sponsor_petition.action}”" in the email subject And they should see "#{@sponsor_petition.action}" in the email body And they should see "#{@sponsor_petition.background}" in the email body And they should see "#{@sponsor_petition.additional_details}" in the email body @@ -160,8 +160,8 @@ Then(/^(I|they|".*?") should be emailed a link for gathering support from sponsors$/) do |address| steps %{ - Then #{address} should receive an email with subject "Action required: Petition" - When they open the email with subject "Action required: Petition" + Then #{address} should receive an email with subject "Get supporters for:" + When they open the email with subject "Get supporters for:" Then they should see /\/petitions\/\\d+\/sponsors\/[A-Za-z0-9]+/ in the email body } end diff --git a/features/step_definitions/sponsor_support_nofitication_steps.rb b/features/step_definitions/sponsor_support_nofitication_steps.rb index a5e1d2ab5..ee60024bf 100644 --- a/features/step_definitions/sponsor_support_nofitication_steps.rb +++ b/features/step_definitions/sponsor_support_nofitication_steps.rb @@ -1,24 +1,24 @@ Then(/^I should receive a sponsor support notification email$/) do - step %{"charlie.the.creator@example.com" should receive an email with subject "supported your petition"} + step %{"charlie.the.creator@example.com" should receive an email with subject "Someone supported: “#{@sponsor_petition.action}”"} end Then(/^I should not receive a sponsor support notification email$/) do - step %{"charlie.the.creator@example.com" should receive no email with subject "supported your petition"} + step %{"charlie.the.creator@example.com" should receive no email with subject "Someone supported: “#{@sponsor_petition.action}”"} end Then(/^I should receive a sponsor threshold notification email$/) do - step %{"charlie.the.creator@example.com" should receive an email with subject "We’re checking your petition"} + step %{"charlie.the.creator@example.com" should receive an email with subject "Your petition has five supporters: “#{@sponsor_petition.action}”"} end Then(/^I should not receive a sponsor threshold notification email$/) do - step %{"charlie.the.creator@example.com" should receive no email with subject "We’re checking your petition"} + step %{"charlie.the.creator@example.com" should receive no email with subject "Your petition has five supporters: “#{@sponsor_petition.action}”"} end Then(/^the sponsor support notification email should include the countdown to the threshold$/) do signed = @sponsor_petition.sponsors.validated.count threshold = Site.threshold_for_moderation email = open_last_email_for("charlie.the.creator@example.com") - expect(email.subject).to match /supported your petition/ + expect(email.subject).to match /Someone supported/ mail_body = email.default_part_body.to_s expect(mail_body).to include "You have #{signed} #{'supporter'.pluralize(signed)} so far" end @@ -27,8 +27,7 @@ threshold = Site.threshold_for_moderation email = open_last_email_for("charlie.the.creator@example.com") - expect(email.subject).to match /We’re checking your petition/ + expect(email.subject).to match /Your petition has five supporters/ mail_body = email.default_part_body.to_s - expect(mail_body).to include "#{threshold} people have supported your petition so far" - expect(mail_body).not_to match /support from \d+ of your nominated sponsors/ + expect(mail_body).to include "#{threshold} people have supported your petition" end diff --git a/features/suzie_signs_a_petition.feature b/features/suzie_signs_a_petition.feature index 276fc3b04..b2a78c482 100644 --- a/features/suzie_signs_a_petition.feature +++ b/features/suzie_signs_a_petition.feature @@ -76,7 +76,7 @@ Feature: Suzie signs a petition And I fill in my details And I try to sign And I say I am happy with my email address - Then "WOMBOID@wimbledon.com" should receive 1 email with subject "Duplicate signature of petition" + Then "WOMBOID@wimbledon.com" should receive 1 email with subject "You have tried to sign this petition twice" Scenario: Suzie receives a duplicate signature email if she changes to her original email but she has already signed and validated When I have already signed the petition with an uppercase email @@ -85,7 +85,7 @@ Feature: Suzie signs a petition And I try to sign When I change my email address to "womboid@wimbledon.com" And I say I am happy with my email address - Then "WOMBOID@wimbledon.com" should receive 1 email with subject "Duplicate signature of petition" + Then "WOMBOID@wimbledon.com" should receive 1 email with subject "You have tried to sign this petition twice" Scenario: Suzie receives a duplicate signature email if an alias has been used to sign the petition already Given "wimbledon.com" is configured to normalize email address @@ -94,7 +94,7 @@ Feature: Suzie signs a petition And I fill in my details with postcode "N1 1TY" And I try to sign And I say I am happy with my email address - Then "wom.boid@wimbledon.com" should receive 1 email with subject "Duplicate signature of petition" + Then "wom.boid@wimbledon.com" should receive 1 email with subject "You have tried to sign this petition twice" Scenario: Suzie receives another email if she has already signed but not validated When I have already signed the petition but not validated my email diff --git a/spec/controllers/admin/archived/government_response_controller_spec.rb b/spec/controllers/admin/archived/government_response_controller_spec.rb index decfeca3a..017417439 100644 --- a/spec/controllers/admin/archived/government_response_controller_spec.rb +++ b/spec/controllers/admin/archived/government_response_controller_spec.rb @@ -211,10 +211,10 @@ def do_patch(overrides = {}) ['laura_1@example.com'], ['laura_2@example.com'] ]) - expect(ActionMailer::Base.deliveries[0].subject).to match(/Government responded to “#{petition.action}”/) - expect(ActionMailer::Base.deliveries[1].subject).to match(/Government responded to “#{petition.action}”/) - expect(ActionMailer::Base.deliveries[2].subject).to match(/Government responded to “#{petition.action}”/) - expect(ActionMailer::Base.deliveries[3].subject).to match(/Government responded to “#{petition.action}”/) + expect(ActionMailer::Base.deliveries[0].subject).to match(/Government response: “#{petition.action}”/) + expect(ActionMailer::Base.deliveries[1].subject).to match(/Government response: “#{petition.action}”/) + expect(ActionMailer::Base.deliveries[2].subject).to match(/Government response: “#{petition.action}”/) + expect(ActionMailer::Base.deliveries[3].subject).to match(/Government response: “#{petition.action}”/) end end end diff --git a/spec/controllers/admin/government_response_controller_spec.rb b/spec/controllers/admin/government_response_controller_spec.rb index 344ee3f58..0b7c673b7 100644 --- a/spec/controllers/admin/government_response_controller_spec.rb +++ b/spec/controllers/admin/government_response_controller_spec.rb @@ -220,10 +220,10 @@ def do_patch(overrides = {}) ['laura_1@example.com'], ['laura_2@example.com'] ]) - expect(ActionMailer::Base.deliveries[0].subject).to match(/Government responded to “#{petition.action}”/) - expect(ActionMailer::Base.deliveries[1].subject).to match(/Government responded to “#{petition.action}”/) - expect(ActionMailer::Base.deliveries[2].subject).to match(/Government responded to “#{petition.action}”/) - expect(ActionMailer::Base.deliveries[3].subject).to match(/Government responded to “#{petition.action}”/) + expect(ActionMailer::Base.deliveries[0].subject).to match(/Government response: “#{petition.action}”/) + expect(ActionMailer::Base.deliveries[1].subject).to match(/Government response: “#{petition.action}”/) + expect(ActionMailer::Base.deliveries[2].subject).to match(/Government response: “#{petition.action}”/) + expect(ActionMailer::Base.deliveries[3].subject).to match(/Government response: “#{petition.action}”/) end end end diff --git a/spec/controllers/admin/moderation_controller_spec.rb b/spec/controllers/admin/moderation_controller_spec.rb index 4f673bf6b..88452e565 100644 --- a/spec/controllers/admin/moderation_controller_spec.rb +++ b/spec/controllers/admin/moderation_controller_spec.rb @@ -122,12 +122,12 @@ def do_patch(options = patch_options) it "sends an email to the petition creator" do expect(creator_email).to deliver_to("bazbutler@gmail.com") - expect(creator_email).to have_subject(/We published your petition “[^"]+”/) + expect(creator_email).to have_subject(/Your petition is live: “[^"]+”/) end it "sends an email to validated petition sponsors" do expect(sponsor_email).to deliver_to("laurapalmer@gmail.com") - expect(sponsor_email).to have_subject(/We published the petition “[^"]+” that you supported/) + expect(sponsor_email).to have_subject(/We published “[^"]+”/) end it "doesn't send an email to pending petition sponsors" do @@ -186,12 +186,12 @@ def do_patch(options = patch_options) it "sends an email to the petition creator" do expect(creator_email).to deliver_to("bazbutler@gmail.com") - expect(creator_email.subject).to match(/We rejected your petition “[^"]+”/) + expect(creator_email.subject).to match(/Petition not accepted: “[^"]+”/) end it "sends an email to validated petition sponsors" do expect(sponsor_email).to deliver_to("laurapalmer@gmail.com") - expect(sponsor_email.subject).to match(/We rejected the petition “[^"]+” that you supported/) + expect(sponsor_email.subject).to match(/Petition not accepted: “[^"]+”/) end it "does not send an email to pending petition sponsors" do @@ -230,12 +230,12 @@ def do_patch(options = patch_options) it "sends an email to the petition creator" do expect(creator_email).to deliver_to("bazbutler@gmail.com") - expect(creator_email.subject).to match(/We rejected your petition “[^"]+”/) + expect(creator_email.subject).to match(/Petition not accepted: “[^"]+”/) end it "sends an email to validated petition sponsors" do expect(sponsor_email).to deliver_to("laurapalmer@gmail.com") - expect(sponsor_email.subject).to match(/We rejected the petition “[^"]+” that you supported/) + expect(sponsor_email.subject).to match(/Petition not accepted: “[^"]+”/) end it "does not send an email to pending petition sponsors" do diff --git a/spec/controllers/admin/petitions_controller_spec.rb b/spec/controllers/admin/petitions_controller_spec.rb index 8fd4ba438..266191a10 100644 --- a/spec/controllers/admin/petitions_controller_spec.rb +++ b/spec/controllers/admin/petitions_controller_spec.rb @@ -120,11 +120,11 @@ end it "resends the email to the petition creator" do - expect(mailbox_for("bob@example.com").last).to have_subject("Action required: Petition “Do Stuff!”") + expect(mailbox_for("bob@example.com").last).to have_subject("Get supporters for: “Do Stuff!”") end it "sends a copy of the email to the feedback address" do - expect(mailbox_for("petitionscommittee@parliament.uk").last).to have_subject("Action required: Petition “Do Stuff!”") + expect(mailbox_for("petitionscommittee@parliament.uk").last).to have_subject("Get supporters for: “Do Stuff!”") end end end diff --git a/spec/controllers/admin/take_down_controller_spec.rb b/spec/controllers/admin/take_down_controller_spec.rb index e323d89b4..e64fb85a7 100644 --- a/spec/controllers/admin/take_down_controller_spec.rb +++ b/spec/controllers/admin/take_down_controller_spec.rb @@ -144,12 +144,12 @@ def do_patch(overrides = {}) it "sends an email to the petition creator" do expect(creator_email).to deliver_to("bazbutler@gmail.com") - expect(creator_email.subject).to match(/We rejected your petition “[^"]+”/) + expect(creator_email.subject).to match(/Petition not accepted: “[^"]+”/) end it "sends an email to validated petition sponsors" do expect(sponsor_email).to deliver_to("laurapalmer@gmail.com") - expect(sponsor_email.subject).to match(/We rejected the petition “[^"]+” that you supported/) + expect(sponsor_email.subject).to match(/Petition not accepted: “[^"]+”/) end it "does not send an email to pending petition sponsors" do @@ -185,12 +185,12 @@ def do_patch(overrides = {}) it "sends an email to the petition creator" do expect(creator_email).to deliver_to("bazbutler@gmail.com") - expect(creator_email.subject).to match(/We rejected your petition “[^"]+”/) + expect(creator_email.subject).to match(/Petition not accepted: “[^"]+”/) end it "sends an email to validated petition sponsors" do expect(sponsor_email).to deliver_to("laurapalmer@gmail.com") - expect(sponsor_email.subject).to match(/We rejected the petition “[^"]+” that you supported/) + expect(sponsor_email.subject).to match(/Petition not accepted: “[^"]+”/) end it "does not send an email to pending petition sponsors" do diff --git a/spec/controllers/petitions_controller_spec.rb b/spec/controllers/petitions_controller_spec.rb index 43a3690e3..791077c30 100644 --- a/spec/controllers/petitions_controller_spec.rb +++ b/spec/controllers/petitions_controller_spec.rb @@ -108,7 +108,7 @@ expect(last_email_sent).to deliver_to("john@example.com") expect(last_email_sent).to deliver_from(%{"Petitions: UK Government and Parliament" }) - expect(last_email_sent).to have_subject("Action required: Petition “Save the planet”") + expect(last_email_sent).to have_subject("Get supporters for: “Save the planet”") end it "should successfully point the signature at the petition" do diff --git a/spec/controllers/signatures_controller_spec.rb b/spec/controllers/signatures_controller_spec.rb index c3568fdb2..64a1f847a 100644 --- a/spec/controllers/signatures_controller_spec.rb +++ b/spec/controllers/signatures_controller_spec.rb @@ -351,7 +351,7 @@ it "sends a confirmation email" do expect(last_email_sent).to deliver_to("ted@example.com") - expect(last_email_sent).to have_subject("Please confirm your email address") + expect(last_email_sent).to have_subject("Confirm your email to sign “#{petition.action}”") end it "redirects to the thank you page" do @@ -394,7 +394,7 @@ it "re-sends the confirmation email" do expect(last_email_sent).to deliver_to("ted@example.com") - expect(last_email_sent).to have_subject("Please confirm your email address") + expect(last_email_sent).to have_subject("Confirm your email to sign “#{petition.action}”") end it "redirects to the thank you page" do @@ -423,7 +423,7 @@ it "re-sends the confirmation email" do expect(last_email_sent).to deliver_to("ted@example.com") - expect(last_email_sent).to have_subject("Please confirm your email address") + expect(last_email_sent).to have_subject("Confirm your email to sign “#{petition.action}”") end it "redirects to the thank you page" do @@ -450,7 +450,7 @@ it "sends a duplicate signature email" do expect(last_email_sent).to deliver_to("ted@example.com") - expect(last_email_sent).to have_subject("Duplicate signature of petition") + expect(last_email_sent).to have_subject(/You have tried to sign this petition twice: “[^”]+”/) end it "redirects to the thank you page" do @@ -479,7 +479,7 @@ it "sends a duplicate signature email" do expect(last_email_sent).to deliver_to("ted@example.com") - expect(last_email_sent).to have_subject("Duplicate signature of petition") + expect(last_email_sent).to have_subject(/You have tried to sign this petition twice: “[^”]+”/) end it "redirects to the thank you page" do diff --git a/spec/controllers/sponsors_controller_spec.rb b/spec/controllers/sponsors_controller_spec.rb index a9e6ecaa7..d97f7f6d1 100644 --- a/spec/controllers/sponsors_controller_spec.rb +++ b/spec/controllers/sponsors_controller_spec.rb @@ -354,7 +354,7 @@ it "sends a confirmation email" do expect(last_email_sent).to deliver_to("ted@example.com") - expect(last_email_sent).to have_subject("Please confirm your email address") + expect(last_email_sent).to have_subject("Sign to support: “#{petition.action}”") end it "redirects to the thank you page" do @@ -397,7 +397,7 @@ it "re-sends the confirmation email" do expect(last_email_sent).to deliver_to("ted@example.com") - expect(last_email_sent).to have_subject("Please confirm your email address") + expect(last_email_sent).to have_subject("Sign to support: “#{petition.action}”") end it "redirects to the thank you page" do @@ -426,7 +426,7 @@ it "re-sends the confirmation email" do expect(last_email_sent).to deliver_to("ted@example.com") - expect(last_email_sent).to have_subject("Please confirm your email address") + expect(last_email_sent).to have_subject("Sign to support: “#{petition.action}”") end it "redirects to the thank you page" do @@ -453,7 +453,7 @@ it "sends a duplicate signature email" do expect(last_email_sent).to deliver_to("ted@example.com") - expect(last_email_sent).to have_subject("Duplicate signature of petition") + expect(last_email_sent).to have_subject("You have tried to sign this petition twice: “#{petition.action}”") end it "redirects to the thank you page" do @@ -482,7 +482,7 @@ it "sends a duplicate signature email" do expect(last_email_sent).to deliver_to("ted@example.com") - expect(last_email_sent).to have_subject("Duplicate signature of petition") + expect(last_email_sent).to have_subject("You have tried to sign this petition twice: “#{petition.action}”") end it "redirects to the thank you page" do @@ -780,7 +780,7 @@ it "sends email notification to the petition creator" do expect(last_email_sent).to deliver_to("bob@example.com") - expect(last_email_sent).to have_subject("Alice supported your petition") + expect(last_email_sent).to have_subject("Someone supported: “#{petition.action}”") end it "redirects to the signed signature page" do @@ -854,7 +854,7 @@ it "sends email notification to the petition creator" do expect(last_email_sent).to deliver_to("bob@example.com") - expect(last_email_sent).to have_subject("Alice supported your petition") + expect(last_email_sent).to have_subject("Someone supported: “#{petition.action}”") end it "redirects to the signed signature page" do @@ -906,7 +906,7 @@ it "sends email notification to the petition creator" do expect(last_email_sent).to deliver_to("bob@example.com") - expect(last_email_sent).to have_subject("We’re checking your petition") + expect(last_email_sent).to have_subject("Your petition has five supporters: “#{petition.action}”") end it "redirects to the signed signature page" do @@ -939,7 +939,7 @@ it "sends email notification to the petition creator" do expect(last_email_sent).to deliver_to("bob@example.com") - expect(last_email_sent).to have_subject("We’re checking your petition") + expect(last_email_sent).to have_subject("Your petition has five supporters: “#{petition.action}”") end it "redirects to the signed signature page" do diff --git a/spec/mailers/archived/petition_mailer_spec.rb b/spec/mailers/archived/petition_mailer_spec.rb index bd9bb697b..2452a0bc2 100644 --- a/spec/mailers/archived/petition_mailer_spec.rb +++ b/spec/mailers/archived/petition_mailer_spec.rb @@ -53,40 +53,16 @@ end it "has the correct subject" do - expect(mail).to have_subject("Government responded to “Allow organic vegetable vans to use red diesel”") + expect(mail).to have_subject("Government response: “Allow organic vegetable vans to use red diesel”") end it "has response summary in the body" do expect(mail).to have_body_text("Sounds like a good idea") end - it "has response details in the body" do - expect(mail).to have_body_text("We’ll get right on that") - end - it "includes a link to read the response online" do expect(mail).to have_body_text(%r[https://petition.parliament.uk/archived/petitions/#{petition.id}\?reveal_response=yes]) end - - context "when the signature count is less than the debate threshold" do - let(:signature_count) { 12345 } - - it "includes a message about the committee's response" do - expect(mail).to have_body_text("The Petitions Committee will take a look at this petition and its response.") - expect(mail).to have_body_text("They can press the government for action and gather evidence.") - expect(mail).to have_body_text("If this petition reaches 100,000 signatures, the Committee will consider it for a debate.") - end - end - - context "when the signature count is more than the debate threshold" do - let(:signature_count) { 123456 } - - it "includes a message about the committee's response" do - expect(mail).to have_body_text("This petition has over 100,000 signatures.") - expect(mail).to have_body_text("The Petitions Committee will consider it for a debate.") - expect(mail).to have_body_text("They can also gather further evidence and press the government for action.") - end - end end context "when the signature is the creator" do @@ -105,8 +81,20 @@ expect(mail).to have_body_text("Dear Barry Butler,") end + it "has response details in the body" do + expect(mail).to have_body_text("We’ll get right on that") + end + it "has the message in the body" do - expect(mail).to have_body_text("The Government has responded to your petition") + expect(mail).to have_body_text("Government has responded") + end + + context "when the signature count is less than the debate threshold" do + let(:signature_count) { 12345 } + + it "includes a message about the committee's response" do + expect(mail).to have_body_text("If it reaches 100,000 signatures, the Petitions Committee will consider whether MPs debate it in the House of Commons.") + end end end @@ -126,9 +114,21 @@ expect(mail).to have_body_text("Dear Laura Palmer,") end + it "doesn't have response details in the body" do + expect(mail).not_to have_body_text("We’ll get right on that") + end + it "has the message in the body" do expect(mail).to have_body_text("The Government has responded to the petition you signed") end + + context "when the signature count is less than the debate threshold" do + let(:signature_count) { 12345 } + + it "includes a message about the committee's response" do + expect(mail).to have_body_text("If 100,000 people sign the petition, the Petitions Committee will consider whether MPs debate it in Parliament.") + end + end end end @@ -163,10 +163,6 @@ expect(mail).to have_header("List-Unsubscribe-Post", "List-Unsubscribe=One-Click") end - it "has the correct subject" do - expect(mail).to have_subject("Parliament will debate “Allow organic vegetable vans to use red diesel”") - end - it "has the scheduled debate date in the body" do expect(mail).to have_body_text("12 September 2017") end @@ -188,8 +184,12 @@ expect(mail).to have_body_text("Dear Barry Butler,") end + it "has the correct subject" do + expect(mail).to have_subject("Debate on your petition: “Allow organic vegetable vans to use red diesel”") + end + it "has the message in the body" do - expect(mail).to have_body_text("Parliament is going to debate your petition") + expect(mail).to have_body_text("MPs are going to debate your petition") end end @@ -209,8 +209,12 @@ expect(mail).to have_body_text("Dear Laura Palmer,") end + it "has the correct subject" do + expect(mail).to have_subject("MPs will debate “Allow organic vegetable vans to use red diesel”") + end + it "has the message in the body" do - expect(mail).to have_body_text("Parliament is going to debate the petition you signed") + expect(mail).to have_body_text("MPs are going to debate the petition you signed") end end end @@ -254,7 +258,7 @@ shared_examples_for "a positive debate outcome email" do it "has the correct subject" do - expect(mail).to have_subject("Parliament debated “Allow organic vegetable vans to use red diesel”") + expect(mail).to have_subject("Your petition was debated: “Allow organic vegetable vans to use red diesel”") end it "has the positive message in the body" do @@ -264,7 +268,7 @@ shared_examples_for "a negative debate outcome email" do it "has the correct subject" do - expect(mail).to have_subject('Parliament didn’t debate “Allow organic vegetable vans to use red diesel”') + expect(mail).to have_subject('Your petition will not be debated: “Allow organic vegetable vans to use red diesel”') end it "has the negative message in the body" do @@ -391,7 +395,7 @@ shared_examples_for "a positive debate outcome email" do it "has the correct subject" do - expect(mail).to have_subject("Parliament debated “Allow organic vegetable vans to use red diesel”") + expect(mail).to have_subject("MPs debated the petition “Allow organic vegetable vans to use red diesel”") end it "has the positive message in the body" do @@ -401,7 +405,7 @@ shared_examples_for "a negative debate outcome email" do it "has the correct subject" do - expect(mail).to have_subject("Parliament didn’t debate “Allow organic vegetable vans to use red diesel”") + expect(mail).to have_subject("MPs will not debate the petition “Allow organic vegetable vans to use red diesel”") end it "has the negative message in the body" do diff --git a/spec/mailers/petition_mailer_spec.rb b/spec/mailers/petition_mailer_spec.rb index 161491142..8eb551ea8 100644 --- a/spec/mailers/petition_mailer_spec.rb +++ b/spec/mailers/petition_mailer_spec.rb @@ -56,7 +56,7 @@ end it "has an appropriate subject heading" do - expect(mail).to have_subject('We published your petition “Allow organic vegetable vans to use red diesel”') + expect(mail).to have_subject('Your petition is live: “Allow organic vegetable vans to use red diesel”') end it "is addressed to the creator" do @@ -90,7 +90,7 @@ end it "has an appropriate subject heading" do - expect(mail).to have_subject('We published the petition “Allow organic vegetable vans to use red diesel” that you supported') + expect(mail).to have_subject('We published “Allow organic vegetable vans to use red diesel”') end it "is addressed to the sponsor" do @@ -118,7 +118,7 @@ end it "has an appropriate subject heading" do - expect(mail).to have_subject('We rejected your petition “Allow organic vegetable vans to use red diesel”') + expect(mail).to have_subject('Petition not accepted: “Allow organic vegetable vans to use red diesel”') end it "is addressed to the creator" do @@ -174,7 +174,7 @@ end it "has an appropriate subject heading" do - expect(mail).to have_subject('We rejected the petition “Allow organic vegetable vans to use red diesel” that you supported') + expect(mail).to have_subject('Petition not accepted: “Allow organic vegetable vans to use red diesel”') end it "is addressed to the sponsor" do @@ -224,7 +224,7 @@ end it "has an appropriate subject heading" do - expect(mail).to have_subject("We’re closing your petition early") + expect(mail).to have_subject("General Election: your petition is closing") end it "is addressed to the creator" do @@ -258,7 +258,7 @@ end it "has an appropriate subject heading" do - expect(mail).to have_subject("We’re closing petitions early") + expect(mail).to have_subject("General Election: all petitions to close") end it "is addressed to the creator" do @@ -285,7 +285,7 @@ end it "has an appropriate subject heading" do - expect(mail).to have_subject("We’ve stopped your petition early") + expect(mail).to have_subject("General Election: petitions website closing") end it "is addressed to the creator" do @@ -308,7 +308,7 @@ end it "has an appropriate subject heading" do - expect(mail).to have_subject("We’ve stopped your petition early") + expect(mail).to have_subject("General Election: petitions website closing") end it "is addressed to the creator" do @@ -334,7 +334,7 @@ subject(:mail) { described_class.gather_sponsors_for_petition(petition) } it "has the correct subject" do - expect(mail).to have_subject(%{Action required: Petition “Allow organic vegetable vans to use red diesel”}) + expect(mail).to have_subject(%{Get supporters for: “Allow organic vegetable vans to use red diesel”}) end it "has the addresses the creator by name" do @@ -364,118 +364,11 @@ end it "includes information about moderation" do - expect(mail).to have_body_text(%r[Once you’ve gained the required number of supporters]) + expect(mail).to have_body_text(%r[Once you’ve gained five signatures]) end it "includes information about how long the moderation will take" do - expect(mail).to have_body_text(%r[This usually takes a week or less]) - end - - it "doesn't include information about delayed moderation" do - expect(mail).not_to have_body_text(%r[We have a very large number of petitions to check]) - end - - context "during Christmas" do - before do - allow(Holiday).to receive(:christmas?).and_return(true) - end - - it "includes information about delayed moderation" do - expect(mail).to have_body_text(%r[but over the Christmas period it will take us a little longer]) - end - - context "when there is a moderation delay" do - let(:moderation_queue) { 500 } - - it "includes information about delayed moderation" do - expect(mail).to have_body_text(%r[We have a very large number of petitions to check]) - end - - it "doesn't include information about Christmas" do - expect(mail).not_to have_body_text(%r[but over the Christmas period it will take us a little longer]) - end - - context "and the moderation delay message has been customized" do - before do - allow(Site).to receive(:moderation_delay_message).and_return <<~MESSAGE.squish - Due to recent world events we have a very large number of petitions to - check at the moment so it may take a few weeks. Thank you for your patience. - MESSAGE - end - - it "includes the custom message" do - expect(mail).to have_body_text(%r[Due to recent world events]) - end - - it "doesn't include the normal message" do - expect(mail).not_to have_body_text(%r[This usually takes a week or less]) - end - end - end - end - - context "during Easter" do - before do - allow(Holiday).to receive(:easter?).and_return(true) - end - - it "includes information about delayed moderation" do - expect(mail).to have_body_text(%r[but over the Easter period it will take us a little longer]) - end - - context "when there is a moderation delay" do - let(:moderation_queue) { 500 } - - it "includes information about delayed moderation" do - expect(mail).to have_body_text(%r[We have a very large number of petitions to check]) - end - - it "doesn't include information about Christmas" do - expect(mail).not_to have_body_text(%r[but over the Easter period it will take us a little longer]) - end - - context "and the moderation delay message has been customized" do - before do - allow(Site).to receive(:moderation_delay_message).and_return <<~MESSAGE.squish - Due to recent world events we have a very large number of petitions to - check at the moment so it may take a few weeks. Thank you for your patience. - MESSAGE - end - - it "includes the custom message" do - expect(mail).to have_body_text(%r[Due to recent world events]) - end - - it "doesn't include the normal message" do - expect(mail).not_to have_body_text(%r[This usually takes a week or less]) - end - end - end - end - - context "when there is a moderation delay" do - let(:moderation_queue) { 500 } - - it "includes information about delayed moderation" do - expect(mail).to have_body_text(%r[We have a very large number of petitions to check]) - end - - context "and the moderation delay message has been customized" do - before do - allow(Site).to receive(:moderation_delay_message).and_return <<~MESSAGE.squish - Due to recent world events we have a very large number of petitions to - check at the moment so it may take a few weeks. Thank you for your patience. - MESSAGE - end - - it "includes the custom message" do - expect(mail).to have_body_text(%r[Due to recent world events]) - end - - it "doesn't include the normal message" do - expect(mail).not_to have_body_text(%r[This usually takes a week or less]) - end - end + expect(mail).to have_body_text(%r[This can take up to 10 working days]) end context "when a BCC address is passed" do @@ -528,7 +421,7 @@ shared_examples_for "a positive debate outcome email" do it "has the correct subject" do - expect(mail).to have_subject("Parliament debated “Allow organic vegetable vans to use red diesel”") + expect(mail).to have_subject("Your petition was debated: “Allow organic vegetable vans to use red diesel”") end it "has the positive message in the body" do @@ -538,7 +431,7 @@ shared_examples_for "a negative debate outcome email" do it "has the correct subject" do - expect(mail).to have_subject('Parliament didn’t debate “Allow organic vegetable vans to use red diesel”') + expect(mail).to have_subject('Your petition will not be debated: “Allow organic vegetable vans to use red diesel”') end it "has the negative message in the body" do @@ -654,7 +547,7 @@ shared_examples_for "a positive debate outcome email" do it "has the correct subject" do - expect(mail).to have_subject("Parliament debated “Allow organic vegetable vans to use red diesel”") + expect(mail).to have_subject("MPs debated the petition “Allow organic vegetable vans to use red diesel”") end it "has the positive message in the body" do @@ -664,7 +557,7 @@ shared_examples_for "a negative debate outcome email" do it "has the correct subject" do - expect(mail).to have_subject("Parliament didn’t debate “Allow organic vegetable vans to use red diesel”") + expect(mail).to have_subject("MPs will not debate the petition “Allow organic vegetable vans to use red diesel”") end it "has the negative message in the body" do @@ -781,11 +674,11 @@ it_behaves_like "a debate scheduled email" it "has the correct subject" do - expect(mail).to have_subject("Parliament will debate “Allow organic vegetable vans to use red diesel”") + expect(mail).to have_subject("Debate on your petition: “Allow organic vegetable vans to use red diesel”") end it "identifies them as the creator" do - expect(mail).to have_body_text(%[Parliament is going to debate your petition]) + expect(mail).to have_body_text(%[MPs are going to debate your petition]) end end @@ -796,11 +689,11 @@ it_behaves_like "a debate scheduled email" it "has the correct subject" do - expect(mail).to have_subject("Parliament will debate “Allow organic vegetable vans to use red diesel”") + expect(mail).to have_subject("MPs will debate “Allow organic vegetable vans to use red diesel”") end it "identifies them as a ordinary signature" do - expect(mail).to have_body_text(%[Parliament is going to debate the petition you signed]) + expect(mail).to have_body_text(%[MPs are going to debate the petition you signed]) end end end diff --git a/spec/mailers/sponsor_mailer_spec.rb b/spec/mailers/sponsor_mailer_spec.rb index 58c298560..a44447772 100644 --- a/spec/mailers/sponsor_mailer_spec.rb +++ b/spec/mailers/sponsor_mailer_spec.rb @@ -22,7 +22,7 @@ subject(:mail) { described_class.petition_and_email_confirmation_for_sponsor(sponsor) } it "has the correct subject" do - expect(mail.subject).to eq("Please confirm your email address") + expect(mail.subject).to eq("Sign to support: “#{petition.action}”") end it "sends it only to the sponsor" do @@ -93,7 +93,7 @@ shared_examples_for "a sponsor signed on threshold email" do it "has the correct subject" do - expect(mail.subject).to eq("We’re checking your petition") + expect(mail.subject).to eq("Your petition has five supporters: “#{petition.action}”") end it "sends it only to the creator" do @@ -107,7 +107,7 @@ end it "includes the sponsor's name in the body" do - expect(mail).to have_body_text(%r[Ally Adams]) + expect(mail).to have_body_text(%r[Someone supported your petition]) end it "includes the petition action" do @@ -123,11 +123,11 @@ end it "includes the sponsor count" do - expect(mail).to have_body_text(%r[5 people have supported your petition so far]) + expect(mail).to have_body_text(%r[5 people have supported your petition]) end it "tells the creator that the petition is being checked" do - expect(mail).to have_body_text(%r[We’re checking your petition to make sure it meets the petition standards]) + expect(mail).to have_body_text(%r[We’re checking it to make sure it meets the petition standards]) end context "when there is a moderation delay" do @@ -136,115 +136,6 @@ it "includes information about delayed moderation" do expect(mail).to have_body_text(%r[We have a very large number of petitions to check]) end - - it "doesn't include the normal message" do - expect(mail).not_to have_body_text(%r[This usually takes a week or less]) - end - - context "and the moderation delay message has been customized" do - before do - allow(Site).to receive(:moderation_delay_message).and_return <<~MESSAGE.squish - Due to recent world events we have a very large number of petitions to - check at the moment so it may take a few weeks. Thank you for your patience. - MESSAGE - end - - it "includes the custom message" do - expect(mail).to have_body_text(%r[Due to recent world events]) - end - - it "doesn't include the normal message" do - expect(mail).not_to have_body_text(%r[This usually takes a week or less]) - end - end - end - end - - context "before the Christmas period" do - around do |example| - travel_to("2017-12-21") { example.run } - end - - it_behaves_like "a sponsor signed on threshold email" - - it "doesn't include the moderation delay message" do - expect(mail).not_to have_body_text(%r[over the Christmas period it will take us a little longer than usual]) - end - end - - context "during the Christmas period" do - around do |example| - travel_to("2017-12-26") { example.run } - end - - it_behaves_like "a sponsor signed on threshold email" - - it "includes the moderation delay message" do - expect(mail).to have_body_text(%r[over the Christmas period it will take us a little longer than usual]) - end - - context "when there is a moderation delay" do - let(:moderation_queue) { 500 } - - it "doesn't include information about Christmas" do - expect(mail).not_to have_body_text(%r[over the Christmas period it will take us a little longer]) - end - end - end - - context "after the Christmas period" do - around do |example| - travel_to("2018-01-05") { example.run } - end - - it_behaves_like "a sponsor signed on threshold email" - - it "doesn't include the moderation delay message" do - expect(mail).not_to have_body_text(%r[over the Christmas period it will take us a little longer than usual]) - end - end - - context "before the Easter period" do - around do |example| - travel_to("2018-03-29") { example.run } - end - - it_behaves_like "a sponsor signed on threshold email" - - it "doesn't include the moderation delay message" do - expect(mail).not_to have_body_text(%r[over the Easter period it will take us a little longer than usual]) - end - end - - context "during the Easter period" do - around do |example| - travel_to("2018-04-01") { example.run } - end - - it_behaves_like "a sponsor signed on threshold email" - - it "includes the moderation delay message" do - expect(mail).to have_body_text(%r[over the Easter period it will take us a little longer than usual]) - end - - context "when there is a moderation delay" do - let(:moderation_queue) { 500 } - - it "doesn't include information about Easter" do - expect(mail).not_to have_body_text(%r[over the Easter period it will take us a little longer than usual]) - end - end - end - - context "after the Easter period" do - around do |example| - travel_to("2018-04-10") { example.run } - end - - it_behaves_like "a sponsor signed on threshold email" - - it "doesn't include the moderation delay message" do - expect(mail).not_to have_body_text(%r[over the Easter period it will take us a little longer than usual]) end end end