diff options
author | Matthew Somerville <matthew@mysociety.org> | 2014-03-17 18:39:24 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2014-03-17 19:04:25 +0000 |
commit | 36f50c1e21ef26f0021036568254e70863bdb0cc (patch) | |
tree | b7cf3213cbe2e55989a2a336945477319046844a | |
parent | c5715d14de77d3bbcd144592175c4814eb19bbc8 (diff) |
Change default email indentation to none.
This is very old, no-one seems to want/need it any more,
and more than one reuser does not want it. Fixes #715.
-rwxr-xr-x | bin/handlemail | 1 | ||||
-rwxr-xr-x | bin/zurich-overdue-alert | 1 | ||||
-rw-r--r-- | perllib/FixMyStreet/App.pm | 3 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Default.pm | 8 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Zurich.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/DB/ResultSet/AlertType.pm | 1 | ||||
-rw-r--r-- | perllib/FixMyStreet/DB/ResultSet/Questionnaire.pm | 1 | ||||
-rw-r--r-- | perllib/FixMyStreet/SendReport/Email.pm | 1 | ||||
-rw-r--r-- | t/app/controller/alert_new.t | 2 | ||||
-rw-r--r-- | t/app/controller/questionnaire.t | 3 | ||||
-rw-r--r-- | t/app/helpers/send_email_sample.txt | 29 | ||||
-rw-r--r-- | templates/web/default/admin/config_page.html | 1 |
12 files changed, 20 insertions, 33 deletions
diff --git a/bin/handlemail b/bin/handlemail index 8b8e03be9..8bc016241 100755 --- a/bin/handlemail +++ b/bin/handlemail @@ -57,6 +57,7 @@ my $mail = mySociety::Email::construct_email({ To => $data{return_path}, _template_ => $template, _parameters_ => { }, + _line_indent => '', }); if (mySociety::EmailUtil::EMAIL_SUCCESS diff --git a/bin/zurich-overdue-alert b/bin/zurich-overdue-alert index 500c6b016..4e81b3263 100755 --- a/bin/zurich-overdue-alert +++ b/bin/zurich-overdue-alert @@ -73,7 +73,6 @@ sub send_alert { { _template_ => $template, _parameters_ => $h, - _line_indent => $cobrand->email_indent, To => $to, From => [ FixMyStreet->config('CONTACT_EMAIL'), FixMyStreet->config('CONTACT_NAME') ], }, diff --git a/perllib/FixMyStreet/App.pm b/perllib/FixMyStreet/App.pm index 2e2bf3890..1664f0f30 100644 --- a/perllib/FixMyStreet/App.pm +++ b/perllib/FixMyStreet/App.pm @@ -336,7 +336,7 @@ sub send_email { { _template_ => $email->body, # will get line wrapped _parameters_ => {}, - _line_indent => $c->cobrand->email_indent, + _line_indent => '', $email->header_pairs } ) }; @@ -366,6 +366,7 @@ sub send_email_cron { # } #); + $params->{_line_indent} = ''; my $email = mySociety::Locale::in_gb_locale { mySociety::Email::construct_email($params) }; if ( FixMyStreet->test_mode ) { diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm index a39a98135..832a6bb5c 100644 --- a/perllib/FixMyStreet/Cobrand/Default.pm +++ b/perllib/FixMyStreet/Cobrand/Default.pm @@ -832,14 +832,6 @@ sub prettify_dt { return Utils::prettify_dt( $dt, 1 ); } -=head2 email_indent - -Set to an indent string if you wish to override the default email handling. - -=cut - -sub email_indent { undef; } - sub problem_as_hashref { my $self = shift; my $problem = shift; diff --git a/perllib/FixMyStreet/Cobrand/Zurich.pm b/perllib/FixMyStreet/Cobrand/Zurich.pm index 0a05fe835..087d9046b 100644 --- a/perllib/FixMyStreet/Cobrand/Zurich.pm +++ b/perllib/FixMyStreet/Cobrand/Zurich.pm @@ -278,8 +278,6 @@ sub set_problem_state { $c->forward( 'log_edit', [ $problem->id, 'problem', "state change to $new_state" ] ); } -sub email_indent { ''; } - # Specific administrative displays sub admin_pages { diff --git a/perllib/FixMyStreet/DB/ResultSet/AlertType.pm b/perllib/FixMyStreet/DB/ResultSet/AlertType.pm index cc4fc67fc..8e18832a9 100644 --- a/perllib/FixMyStreet/DB/ResultSet/AlertType.pm +++ b/perllib/FixMyStreet/DB/ResultSet/AlertType.pm @@ -243,7 +243,6 @@ sub _send_aggregated_alert_email(%) { { _template_ => $template, _parameters_ => \%data, - _line_indent => $cobrand->email_indent, From => [ $sender, _($cobrand->contact_name) ], To => $data{alert_email}, }, diff --git a/perllib/FixMyStreet/DB/ResultSet/Questionnaire.pm b/perllib/FixMyStreet/DB/ResultSet/Questionnaire.pm index c85ecbf3a..6f2c19b5e 100644 --- a/perllib/FixMyStreet/DB/ResultSet/Questionnaire.pm +++ b/perllib/FixMyStreet/DB/ResultSet/Questionnaire.pm @@ -102,7 +102,6 @@ sub send_questionnaires_period { { _template_ => $template, _parameters_ => \%h, - _line_indent => $cobrand->email_indent, To => [ [ $row->user->email, $row->name ] ], From => [ $sender, $sender_name ], }, diff --git a/perllib/FixMyStreet/SendReport/Email.pm b/perllib/FixMyStreet/SendReport/Email.pm index e8151f175..d71700020 100644 --- a/perllib/FixMyStreet/SendReport/Email.pm +++ b/perllib/FixMyStreet/SendReport/Email.pm @@ -97,7 +97,6 @@ sub send { { _template_ => $self->get_template( $row ), _parameters_ => $h, - _line_indent => $row->cobrand eq 'zurich' ? '' : undef, # XXX Access to Cobrand module here? To => $self->to, From => $self->send_from( $row ), }, diff --git a/t/app/controller/alert_new.t b/t/app/controller/alert_new.t index 1804da32e..532b071eb 100644 --- a/t/app/controller/alert_new.t +++ b/t/app/controller/alert_new.t @@ -451,7 +451,7 @@ subtest "Test normal alert signups and that alerts are sent" => sub { my $count; for (@emails) { $count++ if $_->body =~ /The following updates have been left on this problem:/; - $count++ if $_->body =~ /The following new problems have been reported to City of\s*Edinburgh Council:/; + $count++ if $_->body =~ /The following new problems have been reported to City of\s+Edinburgh\s+Council:/; $count++ if $_->body =~ /The following nearby problems have been added:/; $count++ if $_->body =~ /\s+-\s+Testing/; } diff --git a/t/app/controller/questionnaire.t b/t/app/controller/questionnaire.t index 3468909b9..6ee7ba58f 100644 --- a/t/app/controller/questionnaire.t +++ b/t/app/controller/questionnaire.t @@ -401,7 +401,8 @@ FixMyStreet::override_config { ok $email, "got an email"; $mech->clear_emails_ok; - like $email->body, qr/fill in this short questionnaire/i, "got questionnaire email"; + (my $body = $email->body) =~ s/\s+/ /g; + like $body, qr/fill in this short questionnaire/i, "got questionnaire email"; ($token) = $email->body =~ m{http://.*?/Q/(\S+)}; ok $token, "extracted questionnaire token '$token'"; diff --git a/t/app/helpers/send_email_sample.txt b/t/app/helpers/send_email_sample.txt index 2fe5272cb..1ccce6a23 100644 --- a/t/app/helpers/send_email_sample.txt +++ b/t/app/helpers/send_email_sample.txt @@ -5,25 +5,24 @@ To: test@recipient.com Content-Transfer-Encoding: quoted-printable From: CONTACT_EMAIL - Hello, +Hello, - This is a test email where foo: bar. +This is a test email where foo: bar. - utf8: =E6=88=91=E4=BB=AC=E5=BA=94=E8=AF=A5=E8=83=BD=E5=A4=9F=E6=97=A0= -=E7=BC=9D=E5=A4=84=E7=90=86UTF8=E7=BC=96=E7=A0=81 +utf8: =E6=88=91=E4=BB=AC=E5=BA=94=E8=AF=A5=E8=83=BD=E5=A4=9F=E6=97=A0=E7=BC= +=9D=E5=A4=84=E7=90=86UTF8=E7=BC=96=E7=A0=81 - indented_text + indented_text - long line: Lorem ipsum dolor sit amet, consectetur adipisicing - elit, sed do eiusmod tempor incididunt ut labore et dolore - magna aliqua. Ut enim ad minim veniam, quis nostrud - exercitation ullamco laboris nisi ut aliquip ex ea commodo - consequat. Duis aute irure dolor in reprehenderit in voluptate - velit esse cillum dolore eu fugiat nulla pariatur. Excepteur - sint occaecat cupidatat non proident, sunt in culpa qui officia - deserunt mollit anim id est laborum. +long line: Lorem ipsum dolor sit amet, consectetur adipisicing elit, +sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. +Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris +nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in +reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla +pariatur. Excepteur sint occaecat cupidatat non proident, sunt in +culpa qui officia deserunt mollit anim id est laborum. - Yours,=20=20 - FixMyStreet.=20= +Yours,=20=20 +FixMyStreet.=20= diff --git a/templates/web/default/admin/config_page.html b/templates/web/default/admin/config_page.html index 77a8be4b1..6fb315a46 100644 --- a/templates/web/default/admin/config_page.html +++ b/templates/web/default/admin/config_page.html @@ -139,7 +139,6 @@ or have any questions.</p> <li>never_confirm_reports: [% c.cobrand.never_confirm_reports %], allow_anonymous_reports: [% c.cobrand.allow_anonymous_reports %], show_unconfirmed_reports: [% c.cobrand.show_unconfirmed_reports %]</li> -<li>email_indent: [% c.cobrand.email_indent %]</li> </ul> [% INCLUDE 'admin/footer.html' %] |