diff options
38 files changed, 425 insertions, 201 deletions
diff --git a/perllib/FixMyStreet/App.pm b/perllib/FixMyStreet/App.pm index 13617a3c0..0d3b024a8 100644 --- a/perllib/FixMyStreet/App.pm +++ b/perllib/FixMyStreet/App.pm @@ -349,7 +349,7 @@ sub send_email { } sub send_email_cron { - my ( $c, $params, $env_from, $env_to, $nomail ) = @_; + my ( $c, $params, $env_from, $env_to, $nomail, $cobrand, $lang_code ) = @_; return 1 if $c->is_abuser( $env_to ); @@ -357,15 +357,31 @@ sub send_email_cron { unpack('h*', random_bytes(5, 1)), FixMyStreet->config('EMAIL_DOMAIN') ); - $params->{_parameters_}->{signature} = ''; - #$params->{_parameters_}->{signature} = $c->view('Email')->render( - # $c, 'signature.txt', { - # additional_template_paths => [ - # FixMyStreet->path_to( 'templates', 'email', $c->cobrand->moniker, $c->stash->{lang_code} )->stringify, - # FixMyStreet->path_to( 'templates', 'email', $c->cobrand->moniker )->stringify, - # ] - # } - #); + # This is all to set the path for the templates processor so we can override + # signature and site names in emails using templates in the old style emails. + # It's a bit involved as not everywhere we use it knows about the cobrand so + # we can't assume there will be one. + my $include_path = FixMyStreet->path_to( 'templates', 'email', 'default' )->stringify; + if ( $cobrand ) { + $include_path = + FixMyStreet->path_to( 'templates', 'email', $cobrand->moniker )->stringify . ':' + . $include_path; + if ( $lang_code ) { + $include_path = + FixMyStreet->path_to( 'templates', 'email', $cobrand->moniker, $lang_code )->stringify . ':' + . $include_path; + } + } + my $tt = Template->new({ + INCLUDE_PATH => $include_path + }); + my ($sig, $site_name); + $tt->process( 'signature.txt', $params, \$sig ); + $params->{_parameters_}->{signature} = $sig; + + $tt->process( 'site_name.txt', $params, \$site_name ); + my $site_title = $cobrand ? $cobrand->site_title : ''; + $params->{_parameters_}->{site_name} = $site_name || $site_title; $params->{_line_indent} = ''; my $email = mySociety::Locale::in_gb_locale { mySociety::Email::construct_email($params) }; diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm index 7b5460c51..56a915c89 100644 --- a/perllib/FixMyStreet/DB/Result/Problem.pm +++ b/perllib/FixMyStreet/DB/Result/Problem.pm @@ -604,7 +604,7 @@ sub body { $body = join( _(' and '), map { my $name = $_->name; - if (mySociety::Config::get('AREA_LINKS_FROM_PROBLEMS')) { + if ($c and mySociety::Config::get('AREA_LINKS_FROM_PROBLEMS')) { '<a href="' . $_->url($c) . '">' . $name . '</a>'; } else { $name; diff --git a/perllib/FixMyStreet/DB/ResultSet/AlertType.pm b/perllib/FixMyStreet/DB/ResultSet/AlertType.pm index 545b54c60..984e698e0 100644 --- a/perllib/FixMyStreet/DB/ResultSet/AlertType.pm +++ b/perllib/FixMyStreet/DB/ResultSet/AlertType.pm @@ -271,6 +271,8 @@ sub _send_aggregated_alert_email(%) { $sender, [ $data{alert_email} ], 0, + $cobrand, + $data{lang} ); if ($result == mySociety::EmailUtil::EMAIL_SUCCESS) { diff --git a/perllib/FixMyStreet/DB/ResultSet/Problem.pm b/perllib/FixMyStreet/DB/ResultSet/Problem.pm index c108f7e29..2f4bc6363 100644 --- a/perllib/FixMyStreet/DB/ResultSet/Problem.pm +++ b/perllib/FixMyStreet/DB/ResultSet/Problem.pm @@ -440,7 +440,7 @@ sub send_reports { lastupdate => \'ms_current_timestamp()', } ); if ( $cobrand->report_sent_confirmation_email && !$h{anonymous_report}) { - _send_report_sent_email( $row, \%h, $nomail ); + _send_report_sent_email( $row, \%h, $nomail, $cobrand ); } debug_print("send successful: OK", $row->id) if $debug_mode; } else { @@ -493,6 +493,7 @@ sub _send_report_sent_email { my $row = shift; my $h = shift; my $nomail = shift; + my $cobrand = shift; my $template = 'confirm_report_sent.txt'; my $template_path = FixMyStreet->path_to( "templates", "email", $row->cobrand, $row->lang, $template )->stringify; @@ -511,7 +512,8 @@ sub _send_report_sent_email { }, mySociety::Config::get('CONTACT_EMAIL'), [ $row->user->email ], - $nomail + $nomail, + $cobrand ); } diff --git a/perllib/FixMyStreet/DB/ResultSet/Questionnaire.pm b/perllib/FixMyStreet/DB/ResultSet/Questionnaire.pm index 6f2c19b5e..64ba8ec6a 100644 --- a/perllib/FixMyStreet/DB/ResultSet/Questionnaire.pm +++ b/perllib/FixMyStreet/DB/ResultSet/Questionnaire.pm @@ -98,6 +98,8 @@ sub send_questionnaires_period { . $row->user->email . "\n" if $params->{verbose}; + $h{site_name} = $cobrand->site_title(); + my $result = FixMyStreet::App->send_email_cron( { _template_ => $template, @@ -107,7 +109,8 @@ sub send_questionnaires_period { }, $sender, [ $row->user->email ], - $params->{nomail} + $params->{nomail}, + $cobrand ); if ($result == mySociety::EmailUtil::EMAIL_SUCCESS) { print " ...success\n" if $params->{verbose}; diff --git a/t/app/controller/alert_new.t b/t/app/controller/alert_new.t index 594d4c7a6..14cf32d7c 100644 --- a/t/app/controller/alert_new.t +++ b/t/app/controller/alert_new.t @@ -12,7 +12,7 @@ foreach my $test ( email => 'test@example.com', type => 'area_problems', content => 'your alert will not be activated', - email_text => 'confirm the alert', + email_text => "confirms that you'd like to receive an email", uri => '/alert/subscribe?type=local&rznvy=test@example.com&feed=area:1000:A_Location', param1 => 1000 @@ -21,7 +21,7 @@ foreach my $test ( email => 'test@example.com', type => 'council_problems', content => 'your alert will not be activated', - email_text => 'confirm the alert', + email_text => "confirms that you'd like to receive an email", uri => '/alert/subscribe?type=local&rznvy=test@example.com&feed=council:1000:A_Location', param1 => 1000, @@ -31,7 +31,7 @@ foreach my $test ( email => 'test@example.com', type => 'ward_problems', content => 'your alert will not be activated', - email_text => 'confirm the alert', + email_text => "confirms that you'd like to receive an email", uri => '/alert/subscribe?type=local&rznvy=test@example.com&feed=ward:1000:1001:A_Location:Diff_Location', param1 => 1000, @@ -41,7 +41,7 @@ foreach my $test ( email => 'test@example.com', type => 'local_problems', content => 'your alert will not be activated', - email_text => 'confirm the alert', + email_text => "confirms that you'd like to receive an email", uri => '/alert/subscribe?type=local&rznvy=test@example.com&feed=local:10.2:20.1', param1 => 20.1, @@ -51,7 +51,7 @@ foreach my $test ( email => 'test@example.com', type => 'new_updates', content => 'your alert will not be activated', - email_text => 'confirm the alert', + email_text => "confirms that you'd like to receive an email", uri => '/alert/subscribe?type=updates&rznvy=test@example.com&id=1', param1 => 1, } @@ -450,9 +450,9 @@ subtest "Test normal alert signups and that alerts are sent" => sub { my @emails = $mech->get_email; 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\s+Council:/; - $count++ if $_->body =~ /The following nearby problems have been added:/; + $count++ if $_->body =~ /The following updates have been left on this report:/; + $count++ if $_->body =~ /The following new FixMyStreet reports have been sent to City of\s+Edinburgh\s+Council:/; + $count++ if $_->body =~ /The following FixMyStreet reports have been made within the area you\s+specified:/; $count++ if $_->body =~ /\s+-\s+Testing/; } is $count, 5, 'Three emails, with five matching lines in them'; @@ -479,6 +479,121 @@ subtest "Test normal alert signups and that alerts are sent" => sub { $mech->delete_user($user2); }; +subtest "Test signature template is used from cobrand" => sub { + $mech->delete_user( 'reporter@example.com' ); + $mech->delete_user( 'alerts@example.com' ); + + my $user1 = FixMyStreet::App->model('DB::User') + ->find_or_create( { email => 'reporter@example.com', name => 'Reporter User' } ); + ok $user1, "created test user"; + + my $user2 = FixMyStreet::App->model('DB::User') + ->find_or_create( { email => 'alerts@example.com', name => 'Alert User' } ); + ok $user2, "created test user"; + + my $dt = DateTime->now()->add( days => 2); + + my $dt_parser = FixMyStreet::App->model('DB')->schema->storage->datetime_parser; + + my $report_time = '2011-03-01 12:00:00'; + my $report = FixMyStreet::App->model('DB::Problem')->find_or_create( { + postcode => 'EH1 1BB', + bodies_str => '2651', + areas => ',11808,135007,14419,134935,2651,20728,', + category => 'Street lighting', + title => 'Testing', + detail => 'Testing Detail', + used_map => 1, + name => $user1->name, + anonymous => 0, + state => 'fixed - user', + confirmed => $dt_parser->format_datetime($dt), + lastupdate => $dt_parser->format_datetime($dt), + whensent => $dt_parser->format_datetime($dt->clone->add( minutes => 5 )), + lang => 'en-gb', + service => '', + cobrand => 'default', + cobrand_data => '', + send_questionnaire => 1, + latitude => '55.951963', + longitude => '-3.189944', + user_id => $user1->id, + } ); + my $report_id = $report->id; + ok $report, "created test report - $report_id"; + + my $alert = FixMyStreet::App->model('DB::Alert')->create( { + parameter => $report_id, + alert_type => 'new_updates', + user => $user1, + cobrand => 'default', + } ); + my $ret = $alert->confirm; + ok $ret, 'created alert for reporter'; + + my $update = FixMyStreet::App->model('DB::Comment')->create( { + problem_id => $report_id, + user_id => $user2->id, + name => 'Other User', + mark_fixed => 'false', + text => 'This is some update text', + state => 'confirmed', + confirmed => $dt->clone->add( hours => 7 ), + anonymous => 'f', + } ); + my $update_id = $update->id; + ok $update, "created test update - $update_id"; + + + $mech->clear_emails_ok; + FixMyStreet::override_config { + MAPIT_URL => 'http://mapit.mysociety.org/', + ALLOWED_COBRANDS => [ { 'fixmystreet' => '.' } ], + }, sub { + FixMyStreet::App->model('DB::AlertType')->email_alerts(); + }; + # TODO Note the below will fail if the db has an existing alert that matches + $mech->email_count_is(1); + + my @emails = $mech->get_email; + my $email = $emails[0]; + like $email->body, qr/All the best/, 'default signature used'; + unlike $email->body, qr/twitter.com/, 'nothing from fixmystreet signature'; + + $update = FixMyStreet::App->model('DB::Comment')->create( { + problem_id => $report_id, + user_id => $user2->id, + name => 'Anonymous User', + mark_fixed => 'true', + text => 'This is some more update text', + state => 'confirmed', + confirmed => $dt->clone->add( hours => 8 ), + anonymous => 't', + } ); + $update_id = $update->id; + ok $update, "created test update - $update_id"; + + $alert->cobrand('fixmystreet'); + $alert->update; + + $mech->clear_emails_ok; + FixMyStreet::override_config { + MAPIT_URL => 'http://mapit.mysociety.org/', + ALLOWED_COBRANDS => [ { 'fixmystreet' => '.' } ], + }, sub { + FixMyStreet::App->model('DB::AlertType')->email_alerts(); + }; + # TODO Note the below will fail if the db has an existing alert that matches + $mech->email_count_is(1); + + @emails = $mech->get_email; + $email = $emails[0]; + like $email->body, qr/twitter.com/, 'fixmystreet signature used'; + + $mech->delete_user($user1); + $mech->delete_user($user2); +}; + for my $test ( { desc => 'check non public reports are not included in council problems alerts', diff --git a/t/app/controller/auth.t b/t/app/controller/auth.t index 3d52c0925..17ba0d1a0 100644 --- a/t/app/controller/auth.t +++ b/t/app/controller/auth.t @@ -66,7 +66,7 @@ $mech->not_logged_in_ok; $mech->email_count_is(1); my $email = $mech->get_email; $mech->clear_emails_ok; - is $email->header('Subject'), "Your FixMyStreet.com account details", + is $email->header('Subject'), "Your FixMyStreet account details", "subject is correct"; is $email->header('To'), $test_email, "to is correct"; diff --git a/t/app/controller/report_new.t b/t/app/controller/report_new.t index 98b0175f8..157d63d01 100644 --- a/t/app/controller/report_new.t +++ b/t/app/controller/report_new.t @@ -587,7 +587,7 @@ foreach my $test ( # receive token my $email = $mech->get_email; ok $email, "got an email"; - like $email->body, qr/confirm the problem/i, "confirm the problem"; + like $email->body, qr/confirm that you want to send your\s+report/i, "confirm the problem"; my ($url) = $email->body =~ m{(http://\S+)}; ok $url, "extracted confirm url '$url'"; @@ -932,7 +932,7 @@ subtest "test report creation for a category that is non public" => sub { my $email = $mech->get_email; ok $email, "got an email"; - like $email->body, qr/confirm the problem/i, "confirm the problem"; + like $email->body, qr/confirm that you want to send your\s+report/i, "confirm the problem"; my ($url) = $email->body =~ m{(http://\S+)}; ok $url, "extracted confirm url '$url'"; @@ -1128,7 +1128,7 @@ for my $test ( my $email = $mech->get_email; ok $email, "got an email"; - like $email->body, qr/confirm the problem/i, "confirm the problem"; + like $email->body, qr/confirm that you want to send your\s+report/i, "confirm the problem"; my ($url) = $email->body =~ m{(https?://\S+)}; ok $url, "extracted confirm url '$url'"; @@ -1298,7 +1298,7 @@ subtest "test Lichfield" => sub { # receive token my $email = $mech->get_email; ok $email, "got an email"; - like $email->body, qr/confirm the problem/i, "confirm the problem"; + like $email->body, qr/to confirm that you want to send your/i, "confirm the problem"; my ($url) = $email->body =~ m{(http://\S+)}; ok $url, "extracted confirm url '$url'"; @@ -1576,7 +1576,7 @@ subtest "extra google analytics code displayed on email confirmation problem cre my $email = $mech->get_email; ok $email, "got an email"; - like $email->body, qr/confirm the problem/i, "confirm the problem"; + like $email->body, qr/confirm that you want to/i, "confirm the problem"; my ($url) = $email->body =~ m{(https?://\S+)}; ok $url, "extracted confirm url '$url'"; diff --git a/t/app/controller/report_updates.t b/t/app/controller/report_updates.t index e84755650..17947a212 100644 --- a/t/app/controller/report_updates.t +++ b/t/app/controller/report_updates.t @@ -355,7 +355,7 @@ for my $test ( my $email = $mech->get_email; ok $email, "got an email"; - like $email->body, qr/confirm the update you/i, "Correct email text"; + like $email->body, qr/confirm your update on/i, "Correct email text"; my ( $url, $url_token ) = $email->body =~ m{(http://\S+/C/)(\S+)}; ok $url, "extracted confirm url '$url'"; @@ -1010,7 +1010,7 @@ subtest 'submit an update for a registered user, creating update by email' => su my $email = $mech->get_email; ok $email, "got an email"; - like $email->body, qr/confirm the update you/i, "Correct email text"; + like $email->body, qr/confirm your update on/i, "Correct email text"; my ( $url, $url_token ) = $email->body =~ m{(http://\S+/C/)(\S+)}; ok $url, "extracted confirm url '$url'"; @@ -1513,7 +1513,7 @@ for my $test ( my $email = $mech->get_email; ok $email, "got an email"; - like $email->body, qr/confirm the update you/i, "Correct email text"; + like $email->body, qr/confirm your update on/i, "Correct email text"; my ( $url, $url_token ) = $email->body =~ m{(http://\S+/C/)(\S+)}; ok $url, "extracted confirm url '$url'"; diff --git a/t/app/model/problem.t b/t/app/model/problem.t index 24ed959af..f15d56bfe 100644 --- a/t/app/model/problem.t +++ b/t/app/model/problem.t @@ -666,8 +666,8 @@ subtest 'check can turn on report sent email alerts' => sub { ok defined( $problem->whensent ), 'whensent set'; $email = $emails[1]; - like $email->header('Subject'), qr/Problem Report Sent/, 'report sent email title correct'; - like $email->body, qr/Your report about/, 'report sent body correct'; + like $email->header('Subject'), qr/FixMyStreet Report Sent/, 'report sent email title correct'; + like $email->body, qr/to submit your report/, 'report sent body correct'; $send_confirmation_mail_override->restore(); }; diff --git a/templates/email/default/alert-confirm.txt b/templates/email/default/alert-confirm.txt index 0d23d7733..886b04b00 100644 --- a/templates/email/default/alert-confirm.txt +++ b/templates/email/default/alert-confirm.txt @@ -1,13 +1,18 @@ -Subject: Confirm your alert on [% INCLUDE 'site-name.txt' | trim %] +Subject: Confirm your [% INCLUDE 'site-name.txt' | trim %] alert -Hi, +Please click on the link below to confirm your [% INCLUDE 'site-name.txt' | trim %] alert. -Please click on the link below to confirm the alert you just -asked to subscribe to on [% INCLUDE 'site-name.txt' | trim %]: + [% token_url %] - [% token_url %] +If you can't click the link, copy and paste it to the address bar of your web +browser. -If you can't click the link, please copy and paste it to the -address bar of your web browser. +This confirms that you'd like to receive an email when someone makes a +[% INCLUDE 'site-name.txt' | trim %] report within your chosen area. + +Email alerts are a free service from [% INCLUDE 'site-name.txt' | trim %]. [% INCLUDE 'signature.txt' %] + +This email was sent automatically, from an unmonitored email account - so +please do not reply to it. diff --git a/templates/email/default/alert-problem-area.txt b/templates/email/default/alert-problem-area.txt index 3696c87d4..2bcf3fbfc 100644 --- a/templates/email/default/alert-problem-area.txt +++ b/templates/email/default/alert-problem-area.txt @@ -1,12 +1,22 @@ -Subject: New problems in <?=$values['area_name']?> on FixMyStreet +Subject: New <?=$values['site_name']?> reports in <?=$values['area_name']?> -The following new problems have been added within +The following new <?=$values['site_name']?> reports have been added in <?=$values['area_name']?>: <?=$values['data']?> <?=$values['signature']?> -To stop receiving emails when there are new problems in -<?=$values['area_name']?>, please follow this link: + +Unsubscribe? + +You asked us to send you an email when someone makes a new <?=$values['site_name']?> +report in <?=$values['area_name']?>. This is a free service from <?=$values['site_name']?>. + +If you no longer wish to receive an email whenever there are new reports in +<?=$values['area_name']?>, please follow this link: + <?=$values['unsubscribe_url']?> + +This email was sent automatically, from an unmonitored email account - so please +do not reply to it. diff --git a/templates/email/default/alert-problem-council.txt b/templates/email/default/alert-problem-council.txt index 5544a2043..8bc9d6d20 100644 --- a/templates/email/default/alert-problem-council.txt +++ b/templates/email/default/alert-problem-council.txt @@ -1,11 +1,22 @@ -Subject: New problems reported to <?=$values['area_name']?> on FixMyStreet +Subject: New <?=$values['site_name']?> reports to <?=$values['area_name']?> -The following new problems have been reported to <?=$values['area_name']?>: +The following new <?=$values['site_name']?> reports have been sent to +<?=$values['area_name']?>: <?=$values['data']?> <?=$values['signature']?> -To stop receiving emails when there are new problems reported to -<?=$values['area_name']?>, please follow this link: + +Unsubscribe? + +You asked us to send you an email when someone makes a new <?=$values['site_name']?> +report to <?=$values['area_name']?>. This is a free service from <?=$values['site_name']?>. + +If you no longer wish to receive an email whenever there are new reports made to +<?=$values['area_name']?>, please follow this link: + <?=$values['unsubscribe_url']?> + +This email was sent automatically, from an unmonitored email account - so please +do not reply to it. diff --git a/templates/email/default/alert-problem-nearby.txt b/templates/email/default/alert-problem-nearby.txt index 0c88dab5a..3dc562840 100644 --- a/templates/email/default/alert-problem-nearby.txt +++ b/templates/email/default/alert-problem-nearby.txt @@ -1,10 +1,22 @@ -Subject: New nearby problems on FixMyStreet +Subject: New reports on <?=$values['site_name']?> -The following nearby problems have been added: +The following <?=$values['site_name']?> reports have been made within the area +you specified: <?=$values['data']?> <?=$values['signature']?> -To stop receiving emails when there are nearby problems, -please follow this link: <?=$values['unsubscribe_url']?> + +Unsubscribe? + +You asked us to send you an email when someone makes a new <?=$values['site_name']?> +report within your chosen area. This is a free service from <?=$values['site_name']?>. + +If you no longer wish to receive an email whenever there are new reports within +this area, please follow this link: + +<?=$values['unsubscribe_url']?> + +This email was sent automatically, from an unmonitored email account - so please +do not reply to it. diff --git a/templates/email/default/alert-problem-ward.txt b/templates/email/default/alert-problem-ward.txt index 9793bcdac..9bcc770b1 100644 --- a/templates/email/default/alert-problem-ward.txt +++ b/templates/email/default/alert-problem-ward.txt @@ -1,12 +1,24 @@ -Subject: New problems reported to <?=$values['area_name']?> within <?=$values['ward_name']?> on FixMyStreet +Subject: New <?=$values['site_name']?> reports to <?=$values['area_name']?> within <?=$values['ward_name']?> -The following new problems have been reported to <?=$values['area_name']?> +The following new <?=$values['site_name']?> reports have been sent to <?=$values['area_name']?> within <?=$values['ward_name']?>: <?=$values['data']?> <?=$values['signature']?> -To stop receiving emails when there are new problems reported to -<?=$values['area_name']?> within <?=$values['ward_name']?>, -please follow this link: <?=$values['unsubscribe_url']?> + +Unsubscribe? + +You subscribed to receive an email every time someone makes a new <?=$values['site_name']?> +report to <?=$values['area_name']?> within <?=$values['ward_name']?>.This is a +free service from <?=$values['site_name']?>. + +If you no longer wish to receive an email whenever there are new reports to +<?=$values['area_name']?> within <?=$values['ward_name']?>, please follow +this link: + +<?=$values['unsubscribe_url']?> + +This email was sent automatically, from an unmonitored email account - so please +do not reply to it. diff --git a/templates/email/default/alert-problem.txt b/templates/email/default/alert-problem.txt index 01e184e0a..edce34931 100644 --- a/templates/email/default/alert-problem.txt +++ b/templates/email/default/alert-problem.txt @@ -1,10 +1,21 @@ -Subject: New problems on FixMyStreet +Subject: New reports on <?=$values['site_name']?> -The following new problems have been added: +The following new reports have been added to <?=$values['site_name']?>: <?=$values['data']?> <?=$values['signature']?> -To stop receiving emails when there are new problems, -please follow this link: <?=$values['unsubscribe_url']?> + +Unsubscribe? + +You subscribed to receive an email when someone makes a new <?=$values['site_name']?> +report. This is a free service from <?=$values['site_name']?>. + +If you no longer wish to receive an email whenever there are new <?=$values['site_name']?> +reports please follow this link: + +<?=$values['unsubscribe_url']?> + +This email was sent automatically, from an unmonitored email account - so please +do not reply to it. diff --git a/templates/email/default/alert-update.txt b/templates/email/default/alert-update.txt index 1140de1fa..93ba11e01 100644 --- a/templates/email/default/alert-update.txt +++ b/templates/email/default/alert-update.txt @@ -1,17 +1,27 @@ -Subject: New updates on problem - '<?=$values['title']?>' +Subject: New <?=$values['site_name']?> updates on report: '<?=$values['title']?>' -The following updates have been left on this problem: +You asked us to send you an email every time an update was made to the +<?=$values['site_name']?> report: <?=$values['title']?>. + +The following updates have been left on this report: <?=$values['data']?> <?=$values['state_message']?> -To view or reply to these updates, please visit the following URL: +If you would like to view or reply to these updates, please visit the following URL: <?=$values['problem_url']?> -You cannot contact anyone by replying to this email. +This email was sent automatically, from an unmonitored email account - so +please do not reply to it. <?=$values['signature']?> -To stop receiving emails when there are new updates on this problem, + +Unsubscribe? + +We currently email you whenever someone leaves an update on the +<?=$values['site_name']?> report: <?=$values['title']?>. + +If you no longer wish to receive an email whenever this report is updated, please follow this link: <?=$values['unsubscribe_url']?> diff --git a/templates/email/default/confirm_report_sent.txt b/templates/email/default/confirm_report_sent.txt index 201888270..735d52027 100644 --- a/templates/email/default/confirm_report_sent.txt +++ b/templates/email/default/confirm_report_sent.txt @@ -1,9 +1,25 @@ -Subject: Problem Report Sent: <?=$values['title']?> +Subject: <?=$values['site_name']?> Report Sent: <?=$values['title']?> -Hi, +Hello, -Your report about "<?=$values['title']?>" has been sent to <?=$values['bodies_name']?>. +Thank you for using <?=$values['site_name']?> to submit your report +"<?=$values['title']?>". -Thanks +This is to confirm that it has now been sent to <?=$values['bodies_name']?>, +who should respond to you directly. + +Your report is also on <?=$values['url']?>, where others may read, comment or +offer advice. + +You should also feel free to add updates to that page, although note that they +will not be sent to your council. + +If you'd like to update your council, please wait for their reply so that you +can respond to them directly. + +Good luck in getting your problem fixed. <?=$values['signature']?> + +This email was sent automatically, from an unmonitored email account - so +please do not reply to it. diff --git a/templates/email/default/login.txt b/templates/email/default/login.txt index 762407b01..360eb8512 100644 --- a/templates/email/default/login.txt +++ b/templates/email/default/login.txt @@ -1,9 +1,13 @@ -Subject: Your FixMyStreet.com account details +Subject: Your [% INCLUDE 'site-name.txt' | trim %] account details -Please click on the link below to confirm your email address. Then you will be -able to view your problem reports and manage them more easily. +Please click on the link below to confirm your email address. [% c.uri_for_action( 'auth/token', token ) %] +Once you've done this, you'll be able to view and manage all reports and +updates you've made on [% INCLUDE 'site-name.txt' | trim %]. + [% INCLUDE 'signature.txt' %] +This email was sent automatically, from an unmonitored email account - so +please do not reply to it. diff --git a/templates/email/default/partial.txt b/templates/email/default/partial.txt index 82bc0cf0e..fb5e17c10 100644 --- a/templates/email/default/partial.txt +++ b/templates/email/default/partial.txt @@ -1,13 +1,16 @@ -Subject: Confirm your report on FixMyStreet +Subject: Confirm your report on [% INCLUDE 'site-name.txt' | trim %] -Hi [% report.name || report.email %], +Hello [% report.name || report.email %], -To confirm the report you have uploaded to FixMyStreet via -[% report.service %], and to check or add any details, -please visit the following URL: +To confirm the report you have uploaded to [% INCLUDE 'site-name.txt' | trim %] +via [% report.service %], and to check or add any details, please visit the +following URL: [% token_url %] Thanks! [% INCLUDE 'signature.txt' %] + +This email was sent automatically, from an unmonitored email account - so +please do not reply to it. diff --git a/templates/email/default/problem-confirm.txt b/templates/email/default/problem-confirm.txt index 3a6bbe03a..ab4870bb1 100644 --- a/templates/email/default/problem-confirm.txt +++ b/templates/email/default/problem-confirm.txt @@ -1,19 +1,31 @@ -Subject: Confirm your problem on [% INCLUDE 'site-name.txt' | trim %] +Subject: Confirm your report on [% INCLUDE 'site-name.txt' | trim %] -Hi [% report.name %], +Hello [% report.name %], -Please click on the link below to confirm the problem you just -added to [% INCLUDE 'site-name.txt' | trim %]: +Please click on the link below to confirm that you want to send your report to +[% report.body %]. Note that your report will also appear on the [% INCLUDE 'site-name.txt' | trim %] +website: [% token_url %] -If your email program does not let you click on this link, -copy and paste it into your web browser and press return. +If your email program does not let you click on this link, copy and paste it +into your web browser and press return. Your problem had the title: + [% report.title %] And details: + [% report.detail %] +If you no longer wish to send this report, please take no further action. + +Thank you for submitting a report through [% INCLUDE 'site-name.txt' | trim %]. + + + [% INCLUDE 'signature.txt' %] + +This email was sent automatically, from an unmonitored email account - so +please do not reply to it. diff --git a/templates/email/default/questionnaire.txt b/templates/email/default/questionnaire.txt index 88d4cc1b5..4257792da 100644 --- a/templates/email/default/questionnaire.txt +++ b/templates/email/default/questionnaire.txt @@ -1,23 +1,24 @@ -Subject: FixMyStreet questionnaire about '<?=$values['title']?>' +Subject: Questionnaire about your <?=$values['site_name']?> report: '<?=$values['title']?>' -Hi <?=$values['name']?>, +Hello <?=$values['name']?>, -<?=$values['created']?> ago, you left a problem on FixMyStreet -with the details provided at the end of this email. To keep our -site up to date and relevant, we'd appreciate it if you could -follow the link below and fill in our short questionnaire +<?=$values['created']?> ago, you reported a problem using <?=$values['site_name']?>. + +The details of that report are at the end of this email. + +To keep <?=$values['site_name']?> up to date and relevant, we'd appreciate it +if you could follow the link below and fill in our short questionnaire updating the status of your problem: <?=$values['url']?> -Please do not reply to this email; there is a public comment -box on the questionnaire. - <?=$values['signature']?> -Your problem was as follows: +Your report was as follows: <?=$values['title']?> <?=$values['detail']?> +This email was sent automatically, from an unmonitored email account - so +please do not reply to it. diff --git a/templates/email/default/reply-autoresponse b/templates/email/default/reply-autoresponse index f984c66b0..5751dc524 100644 --- a/templates/email/default/reply-autoresponse +++ b/templates/email/default/reply-autoresponse @@ -1,23 +1,39 @@ Subject: Automatic reply to your message to FixMyStreet -Hi, +Hello, -This is an automatic response to your email; your email has not been delivered. +You are receiving this message because you have tried to reply to an automated +email from FixMyStreet. -If you're replying to an email about a report update, please visit -the URL given in the email in order to leave a reply. You cannot -reply to an update via email. +This is an automatic response to your email. -If you are trying to confirm something, such as a report or an email -alert, please click the link in the email that we sent you, or, if -you cannot click the link, copy and paste it into the address bar of -your web browser. +If you are trying to contact your council about a report you have made, please +search your email for their latest communication (or auto-reply), and respond +to that. -If you're trying to unsubscribe from an email alert, there is an -unsubscribe link at the bottom of the email. +Alternatively, if you would like your comment to be published on our website, +you can post it as an update to the original report. Note, however, that updates +are not sent to the council - they are a way for residents to discuss local +problems and offer advice or support. With this in mind, you may wish to both +update your original report, and chase your council via email. -If you have a question or comment about the site, please send your -email to team@fixmystreet.com +If you would like to respond to our question about whether your problem has +been fixed, please follow the link in the email we sent you. + +If you are trying to reply to an update someone has left on your report, please +visit your report page on FixMyStreet and enter your response in the 'update' +box. + +If you are trying to confirm a report or an email alert, please click the link +in the email that we sent you, or, if you cannot click the link, copy and paste +it into the address bar of your web browser. + +If you're trying to unsubscribe from an email alert, there is an unsubscribe +link at the bottom of the email. + +All the best, -Yours, The FixMyStreet team + +This email was sent automatically, from an unmonitored email account - so +please do not reply to it. diff --git a/templates/email/default/signature.txt b/templates/email/default/signature.txt index 69ee38767..f94250564 100644 --- a/templates/email/default/signature.txt +++ b/templates/email/default/signature.txt @@ -1,2 +1,3 @@ -Yours, +All the best, + The FixMyStreet team diff --git a/templates/email/default/submit-brent.txt b/templates/email/default/submit-brent.txt index 75a954765..44c9ad744 100644 --- a/templates/email/default/submit-brent.txt +++ b/templates/email/default/submit-brent.txt @@ -39,5 +39,5 @@ also welcome any other feedback you may have. FixMyStreet is now available for full integration into council websites, making life easier for both you and your residents. -Read more here: http://www.mysociety.org/for-councils/fixmystreet/ +Read more here: http://www.mysociety.org/services/fixmystreet-for-councils/ diff --git a/templates/email/default/submit-example.txt b/templates/email/default/submit-example.txt index 4956a7a93..117584467 100644 --- a/templates/email/default/submit-example.txt +++ b/templates/email/default/submit-example.txt @@ -57,5 +57,5 @@ feedback you may have. FixMyStreet is now available for full integration into council websites, making life easier for both you and your residents. -Read more here: http://www.mysociety.org/for-councils/fixmystreet/ +Read more here: http://www.mysociety.org/services/fixmystreet-for-councils/ diff --git a/templates/email/default/submit.txt b/templates/email/default/submit.txt index 6066a7b68..2a2eae3e6 100644 --- a/templates/email/default/submit.txt +++ b/templates/email/default/submit.txt @@ -39,5 +39,5 @@ also welcome any other feedback you may have. FixMyStreet is now available for full integration into council websites, making life easier for both you and your residents. -Read more here: http://www.mysociety.org/for-councils/fixmystreet/ +Read more here: http://www.mysociety.org/services/fixmystreet-for-councils/ diff --git a/templates/email/default/update-confirm-donotsend.txt b/templates/email/default/update-confirm-donotsend.txt new file mode 100644 index 000000000..bbeffef6e --- /dev/null +++ b/templates/email/default/update-confirm-donotsend.txt @@ -0,0 +1,3 @@ +Note that we do not send updates to [% update.problem.body %] - they are +intended as a place for [% INCLUDE 'site-name.txt' | trim %] users to +discuss, support, and offer advice. diff --git a/templates/email/default/update-confirm.txt b/templates/email/default/update-confirm.txt index beefac9c1..039a3bb39 100644 --- a/templates/email/default/update-confirm.txt +++ b/templates/email/default/update-confirm.txt @@ -1,17 +1,21 @@ Subject: Confirm your update on [% INCLUDE 'site-name.txt' | trim %] -Hi [% update.name %], +Hello [% update.name %], -Please click on the link below to confirm the update you just -wrote: +Please click on the link below to confirm your update on [% INCLUDE 'site-name.txt' | trim %]: [% token_url %] -If your email program does not let you click on this link, -copy and paste it into your web browser and press return. +If your email program does not let you click on this link, copy and paste it +into your web browser and press return. Your update reads: [% update.text %] +[% INCLUDE 'update-confirm-donotsend.txt' %] + [% INCLUDE 'signature.txt' %] + +This email was sent automatically, from an unmonitored email account - so +please do not reply to it. diff --git a/templates/email/fixmystreet/alert-problem-area.txt b/templates/email/fixmystreet/alert-problem-area.txt deleted file mode 100644 index 736e45143..000000000 --- a/templates/email/fixmystreet/alert-problem-area.txt +++ /dev/null @@ -1,14 +0,0 @@ -Subject: New problems in <?=$values['area_name']?> on FixMyStreet - -The following new problems have been added within -<?=$values['area_name']?>: - -<?=$values['data']?> - -------- - -<?=$values['signature']?> - -To stop receiving emails when there are new problems in -<?=$values['area_name']?>, please follow this link: -<?=$values['unsubscribe_url']?> diff --git a/templates/email/fixmystreet/alert-problem-council.txt b/templates/email/fixmystreet/alert-problem-council.txt deleted file mode 100644 index 65b11aceb..000000000 --- a/templates/email/fixmystreet/alert-problem-council.txt +++ /dev/null @@ -1,13 +0,0 @@ -Subject: New problems reported to <?=$values['area_name']?> on FixMyStreet - -The following new problems have been reported to <?=$values['area_name']?>: - -<?=$values['data']?> - -------- - -<?=$values['signature']?> - -To stop receiving emails when there are new problems reported to -<?=$values['area_name']?>, please follow this link: -<?=$values['unsubscribe_url']?> diff --git a/templates/email/fixmystreet/alert-problem-nearby.txt b/templates/email/fixmystreet/alert-problem-nearby.txt deleted file mode 100644 index 17d792a12..000000000 --- a/templates/email/fixmystreet/alert-problem-nearby.txt +++ /dev/null @@ -1,12 +0,0 @@ -Subject: New nearby problems on FixMyStreet - -The following nearby problems have been added: - -<?=$values['data']?> - -------- - -<?=$values['signature']?> - -To stop receiving emails when there are nearby problems, -please follow this link: <?=$values['unsubscribe_url']?> diff --git a/templates/email/fixmystreet/alert-problem-ward.txt b/templates/email/fixmystreet/alert-problem-ward.txt deleted file mode 100644 index dc7a02b9b..000000000 --- a/templates/email/fixmystreet/alert-problem-ward.txt +++ /dev/null @@ -1,14 +0,0 @@ -Subject: New problems reported to <?=$values['area_name']?> within <?=$values['ward_name']?> on FixMyStreet - -The following new problems have been reported to <?=$values['area_name']?> -within <?=$values['ward_name']?>: - -<?=$values['data']?> - -------- - -<?=$values['signature']?> - -To stop receiving emails when there are new problems reported to -<?=$values['area_name']?> within <?=$values['ward_name']?>, -please follow this link: <?=$values['unsubscribe_url']?> diff --git a/templates/email/fixmystreet/alert-problem.txt b/templates/email/fixmystreet/alert-problem.txt deleted file mode 100644 index 12af205f1..000000000 --- a/templates/email/fixmystreet/alert-problem.txt +++ /dev/null @@ -1,12 +0,0 @@ -Subject: New problems on FixMyStreet - -The following new problems have been added: - -<?=$values['data']?> - -------- - -<?=$values['signature']?> - -To stop receiving emails when there are new problems, -please follow this link: <?=$values['unsubscribe_url']?> diff --git a/templates/email/fixmystreet/alert-update.txt b/templates/email/fixmystreet/alert-update.txt deleted file mode 100644 index 7cbf26c44..000000000 --- a/templates/email/fixmystreet/alert-update.txt +++ /dev/null @@ -1,19 +0,0 @@ -Subject: New updates on problem - '<?=$values['title']?>' - -The following updates have been left on this problem: - -<?=$values['data']?> - -<?=$values['state_message']?> - -To view or reply to these updates, please visit the following URL: - <?=$values['problem_url']?> - -You cannot contact anyone by replying to this email. - -------- - -<?=$values['signature']?> - -To stop receiving emails when there are new updates on this problem, -please follow this link: <?=$values['unsubscribe_url']?> diff --git a/templates/email/fixmystreet/signature.txt b/templates/email/fixmystreet/signature.txt new file mode 100644 index 000000000..67906ac2f --- /dev/null +++ b/templates/email/fixmystreet/signature.txt @@ -0,0 +1,11 @@ +All the best, + +The FixMyStreet team + +http://www.FixMyStreet.com +Twitter: https://twitter.com/FixMyStreet +Facebook: http://www.facebook.com/fixmystreet + +Problems? questions? + +Visit http://www.fixmystreet.com/faq diff --git a/templates/email/fixmystreet/update-confirm-donotsend.txt b/templates/email/fixmystreet/update-confirm-donotsend.txt new file mode 100644 index 000000000..2e04dc0bf --- /dev/null +++ b/templates/email/fixmystreet/update-confirm-donotsend.txt @@ -0,0 +1,8 @@ +[% IF update.problem.bodies_str != 2482 AND update.problem.bodies_str != 2347 %] +Note that we do not send updates to [% update.problem.body %] - they are +intended as a place for [% INCLUDE 'site-name.txt' | trim %] users to +discuss, support, and offer advice. +[% ELSE %] +This update will be sent to [% update.problem.body %] and will +also be displayed on the [% INCLUDE 'site-name.txt' | trim %] website. +[% END %] diff --git a/templates/web/fixmystreet/questionnaire/completed-open.html b/templates/web/fixmystreet/questionnaire/completed-open.html index f39083cce..ff19134be 100644 --- a/templates/web/fixmystreet/questionnaire/completed-open.html +++ b/templates/web/fixmystreet/questionnaire/completed-open.html @@ -3,10 +3,30 @@ Thank you very much for filling in our questionnaire. </p> [% ELSE %] + [% IF c.cobrand.moniker == 'fixmystreet' %] + <p style="font-size:150%">We’re sorry to hear that your problem hasn't been fixed.</p> + + <p> + FixMyStreet helps you send a report to your council, but we're not responsible for fixing things. + If you'd like to chase your issue, please search your inbox for the latest reply, or auto-reply + from your council, and respond to that. + </p> + + <p> + Meanwhile, if you're getting nowhere, you might consider writing to your local councillor or other + representative to see if they can help. + </p> + + <p> + You can do this on <a href="https://www.writetothem.com/">https://www.writetothem.com/</a>, another + useful mySociety website. + </p> + [% ELSE %] [% loc('<p style="font-size:150%">We’re sorry to hear that. We have two suggestions: why not try <a href="http://www.writetothem.com/">writing direct to your councillor(s)</a> or, if it’s a problem that could be fixed by local people working together, why not <a href="http://www.pledgebank.com/new">make and publicise a pledge</a>? </p>' ) %] + [% END %] [% END %] |