diff options
28 files changed, 406 insertions, 120 deletions
diff --git a/bin/send-reports b/bin/send-reports index d51276e9d..cec1dee42 100755 --- a/bin/send-reports +++ b/bin/send-reports @@ -3,18 +3,12 @@ # send-reports: # Send new problem reports to councils # -# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. +# Copyright (c) 2011 UK Citizens Online Democracy. All rights reserved. # Email: matthew@mysociety.org. WWW: http://www.mysociety.org -# -# $Id: send-reports,v 1.79 2010-01-06 16:50:26 louise Exp $ use strict; require 5.8.0; -# Horrible boilerplate to set up appropriate library paths. -use FindBin; -use lib "$FindBin::Bin/../perllib"; -use lib "$FindBin::Bin/../commonlib/perllib"; use Digest::MD5; use Encode; use Error qw(:try); @@ -25,11 +19,11 @@ use LWP::Simple; use CGI; # Trying awkward kludge use CronFns; +use FixMyStreet::App; + use EastHantsWSDL; -use Cobrand; use Utils; use mySociety::Config; -use mySociety::DBHandle qw(dbh); use mySociety::Email; use mySociety::EmailUtil; use mySociety::Locale; @@ -37,69 +31,52 @@ use mySociety::MaPit; use mySociety::Random qw(random_bytes); use mySociety::Web qw(ent); -BEGIN { - mySociety::Config::set_file("$FindBin::Bin/../conf/general"); - mySociety::DBHandle::configure( - Name => mySociety::Config::get('BCI_DB_NAME'), - User => mySociety::Config::get('BCI_DB_USER'), - Password => mySociety::Config::get('BCI_DB_PASS'), - Host => mySociety::Config::get('BCI_DB_HOST', undef), - Port => mySociety::Config::get('BCI_DB_PORT', undef) - ); -} - # Set up site, language etc. my ($verbose, $nomail) = CronFns::options(); my $base_url = mySociety::Config::get('BASE_URL'); my $site = CronFns::site($base_url); -my $query = "SELECT id, council, category, title, detail, name, email, phone, - used_map, latitude, longitude, (photo is not null) as has_photo, lang, - cobrand, cobrand_data, date_trunc('second', confirmed) as confirmed, postcode - FROM problem - WHERE state in ('confirmed','fixed') - AND whensent IS NULL - AND council IS NOT NULL"; -my $unsent = dbh()->selectall_arrayref($query, { Slice => {} }); - +my $unsent = FixMyStreet::App->model("DB::Problem")->search( { + state => [ 'confirmed', 'fixed' ], + whensent => undef, + council => { '!=', undef }, +} ); my (%notgot, %note); -my $cobrand; -my $cobrand_data; -foreach my $row (@$unsent) { +while (my $row = $unsent->next) { - $cobrand = $row->{cobrand}; - $cobrand_data = $row->{cobrand_data}; + my $cobrand = FixMyStreet::Cobrand->get_class_for_moniker($row->cobrand)->new(); + # Cobranded and non-cobranded messages can share a database. In this case, the conf file # should specify a vhost to send the reports for each cobrand, so that they don't get sent # more than once if there are multiple vhosts running off the same database. The email_host # call checks if this is the host that sends mail for this cobrand. - next unless (Cobrand::email_host($cobrand)); - Cobrand::set_lang_and_domain($cobrand, $row->{lang}, 1); - if (dbh()->selectrow_array('select email from abuse where lower(email)=?', {}, lc($row->{email}))) { - dbh()->do("update problem set state='hidden' where id=?", {}, $row->{id}); - dbh()->commit(); + next unless $cobrand->email_host(); + $cobrand->set_lang_and_domain($row->lang, 1); + if ( $row->is_from_abuser ) { + $row->update( { state => 'hidden' } ); next; } my $send_email = 0; my $send_web = 0; - mySociety::Locale::change($row->{lang}); - # Template variables for the email - my $email_base_url = Cobrand::base_url_for_emails($cobrand, $cobrand_data); - my %h = map { $_ => $row->{$_} } qw/id title detail name email phone category latitude longitude confirmed used_map/; - $h{query} = $row->{postcode}; - $h{url} = $email_base_url . '/report/' . $row->{id}; + my $email_base_url = $cobrand->base_url_for_emails($row->cobrand_data); + my %h = map { $_ => $row->$_ } qw/id title detail name category latitude longitude used_map/; + map { $h{$_} = $row->user->$_ } qw/email phone/; + $h{confirmed} = DateTime::Format::Pg->format_datetime( $row->confirmed->truncate (to => 'second' ) ); + + $h{query} = $row->postcode; + $h{url} = $email_base_url . '/report/' . $row->id; $h{phone_line} = $h{phone} ? _('Phone:') . " $h{phone}\n\n" : ''; - if ($row->{has_photo}) { + if ($row->photo) { $h{has_photo} = _("This web page also contains a photo of the problem, provided by the user.") . "\n\n"; - $h{image_url} = $email_base_url . '/photo?id=' . $row->{id}; + $h{image_url} = $email_base_url . '/photo?id=' . $row->id; } else { $h{has_photo} = ''; $h{image_url} = ''; } - $h{fuzzy} = $row->{used_map} ? _('To view a map of the precise location of this issue') + $h{fuzzy} = $row->used_map ? _('To view a map of the precise location of this issue') : _('The user could not locate the problem on a map, but to see the area around the location they entered'); $h{closest_address} = ''; @@ -116,35 +93,37 @@ foreach my $row (@$unsent) { $h{closest_address} = find_closest($row, $h{latitude}, $h{longitude}); } - $h{closest_address_machine} = $h{closest_address}; my (@to, @recips, $template, $areas_info); if ($site eq 'emptyhomes') { - my $council = $row->{council}; + my $council = $row->council; $areas_info = mySociety::MaPit::call('areas', $council); my $name = $areas_info->{$council}->{name}; - my ($council_email, $confirmed, $note) = dbh()->selectrow_array( - "SELECT email,confirmed,note FROM contacts WHERE deleted='f' - and area_id=? AND category=?", {}, $council, 'Empty property'); + my $contact = FixMyStreet::App->model("DB::Contact")->find( { + deleted => 0, + area_id => $council, + category => 'Empty property', + } ); + my ($council_email, $confirmed, $note) = ( $contact->email, $contact->confirmed, $contact->note ); unless ($confirmed) { $note = 'Council ' . $council . ' deleted' unless $note; $council_email = 'N/A' unless $council_email; - $notgot{$council_email}{$row->{category}}++; - $note{$council_email}{$row->{category}} = $note; + $notgot{$council_email}{$row->category}++; + $note{$council_email}{$row->category} = $note; next; } push @to, [ $council_email, $name ]; @recips = ($council_email); $send_email = 1; - $template = File::Slurp::read_file("$FindBin::Bin/../templates/emails/submit-eha"); + $template = File::Slurp::read_file("$FindBin::Bin/../templates/email/emptyhomes/" . $row->lang . "/submit.txt"); } else { # XXX Needs locks! - my @all_councils = split /,|\|/, $row->{council}; - my ($councils, $missing) = $row->{council} =~ /^([\d,]+)(?:\|([\d,]+))?/; + my @all_councils = split /,|\|/, $row->council; + my ($councils, $missing) = $row->council =~ /^([\d,]+)(?:\|([\d,]+))?/; my @councils = split(/,/, $councils); $areas_info = mySociety::MaPit::call('areas', \@all_councils); my (@dear, %recips); @@ -158,18 +137,21 @@ foreach my $row (@$unsent) { } elsif ($areas_info->{$council}->{type} eq 'LBO') { # London $send_web = 'london'; } else { - my ($council_email, $confirmed, $note) = dbh()->selectrow_array( - "SELECT email,confirmed,note FROM contacts WHERE deleted='f' - and area_id=? AND category=?", {}, $council, $row->{category}); - $council_email = essex_contact($row->{latitude}, $row->{longitude}) if $council == 2225; - $council_email = oxfordshire_contact($row->{latitude}, $row->{longitude}) if $council == 2237 && $council_email eq 'SPECIAL'; + my $contact = FixMyStreet::App->model("DB::Contact")->find( { + deleted => 0, + area_id => $council, + category => $row->category + } ); + my ($council_email, $confirmed, $note) = ( $contact->email, $contact->confirmed, $contact->note ); + $council_email = essex_contact($row->latitude, $row->longitude) if $council == 2225; + $council_email = oxfordshire_contact($row->latitude, $row->longitude) if $council == 2237 && $council_email eq 'SPECIAL'; unless ($confirmed) { $all_confirmed = 0; - $note = 'Council ' . $row->{council} . ' deleted' + $note = 'Council ' . $row->council . ' deleted' unless $note; $council_email = 'N/A' unless $council_email; - $notgot{$council_email}{$row->{category}}++; - $note{$council_email}{$row->{category}} = $note; + $notgot{$council_email}{$row->category}++; + $note{$council_email}{$row->category} = $note; } push @to, [ $council_email, $name ]; $recips{$council_email} = 1; @@ -179,9 +161,9 @@ foreach my $row (@$unsent) { @recips = keys %recips; next unless $all_confirmed; - $template = 'submit-council'; - $template = 'submit-brent' if $row->{council} eq 2488 || $row->{council} eq 2237; - $template = File::Slurp::read_file("$FindBin::Bin/../templates/emails/$template"); + $template = 'submit.txt'; + $template = 'submit-brent.txt' if $row->council eq 2488 || $row->council eq 2237; + $template = File::Slurp::read_file("$FindBin::Bin/../templates/email/" . $cobrand->moniker . "/$template"); if ($h{category} eq _('Other')) { $h{category_footer} = _('this type of local problem'); @@ -210,11 +192,11 @@ foreach my $row (@$unsent) { } unless ($send_email || $send_web) { - die 'Report not going anywhere for ID ' . $row->{id} . '!'; + die 'Report not going anywhere for ID ' . $row->id . '!'; } my $testing_email = mySociety::Config::get('TESTING_EMAIL'); - if ($row->{email} eq $testing_email) { + if ($row->user->email eq $testing_email) { @recips = ( $testing_email ); $send_web = 0; $send_email = 1; @@ -222,7 +204,7 @@ foreach my $row (@$unsent) { # on a staging server send emails to ourselves rather than the councils @recips = ( mySociety::Config::get('CONTACT_EMAIL') ); } elsif ($site eq 'emptyhomes') { - my $council = $row->{council}; + my $council = $row->council; my $country = $areas_info->{$council}->{country}; if ($country eq 'W') { push @recips, 'shelter@' . mySociety::Config::get('EMAIL_DOMAIN'); @@ -232,7 +214,7 @@ foreach my $row (@$unsent) { } # Special case for this parish council - # if ($address && $address =~ /Sprowston/ && $row->{council} == 2233 && $row->{category} eq 'Street lighting') { + # if ($address && $address =~ /Sprowston/ && $row->council == 2233 && $row->category eq 'Street lighting') { # $h{councils_name} = 'Sprowston Parish Council'; # my $e = 'parishclerk' . '@' . 'sprowston-pc.gov.uk'; # @to = ( [ $e, $h{councils_name} ] ); @@ -243,14 +225,15 @@ foreach my $row (@$unsent) { my $result = -1; if ($send_email) { - $template = _($template); - my $email = mySociety::Locale::in_gb_locale { mySociety::Email::construct_email({ + + my $params = { _template_ => $template, _parameters_ => \%h, To => \@to, - From => [ $row->{email}, $row->{name} ], + From => [ $row->user->email, $row->name ], 'Message-ID' => sprintf('<report-%s-%s@mysociety.org>', time(), unpack('h*', random_bytes(5, 1))), - }) }; + }; + my $email = mySociety::Locale::in_gb_locale { mySociety::Email::construct_email($params) }; if (!$nomail) { $result *= mySociety::EmailUtil::send_email($email, mySociety::Config::get('CONTACT_EMAIL'), @recips); } else { @@ -271,11 +254,10 @@ foreach my $row (@$unsent) { } if ($result == mySociety::EmailUtil::EMAIL_SUCCESS) { - dbh()->do('UPDATE problem SET whensent=ms_current_timestamp(), - lastupdate=ms_current_timestamp() WHERE id=?', {}, $row->{id}); - dbh()->commit(); - } else { - dbh()->rollback(); + $row->update( { + whensent => \'ms_current_timestamp()', + lastupdate => \'ms_current_timestamp()', + } ); } } @@ -449,7 +431,7 @@ sub find_closest { my ($row, $latitude, $longitude) = @_; my $str = ''; - return '' unless $row->{used_map}; + return '' unless $row->used_map; # Get nearest road-type thing from Bing my $url = "http://dev.virtualearth.net/REST/v1/Locations/$latitude,$longitude?c=en-GB&key=" . mySociety::Config::get('BING_MAPS_API_KEY'); diff --git a/perl-external/files.txt b/perl-external/files.txt index b93e46673..762bd9f1d 100644 --- a/perl-external/files.txt +++ b/perl-external/files.txt @@ -198,6 +198,10 @@ /authors/id/R/RJ/RJBS/Data-OptList-0.106.tar.gz /authors/id/R/RJ/RJBS/Email-Address-1.892.tar.gz /authors/id/R/RJ/RJBS/Email-Date-Format-1.002.tar.gz +/authors/id/R/RJ/RJBS/Email-MIME-1.908.tar.gz +/authors/id/R/RJ/RJBS/Email-MIME-ContentType-1.015.tar.gz +/authors/id/R/RJ/RJBS/Email-MIME-Encodings-1.313.tar.gz +/authors/id/R/RJ/RJBS/Email-MessageID-1.402.tar.gz /authors/id/R/RJ/RJBS/Email-Send-2.198.tar.gz /authors/id/R/RJ/RJBS/Email-Simple-2.100.tar.gz /authors/id/R/RJ/RJBS/Email-Valid-0.184.tar.gz diff --git a/perl-external/minicpan/modules/02packages.details.txt.gz b/perl-external/minicpan/modules/02packages.details.txt.gz Binary files differindex 81c6ceef6..50bc1f707 100644 --- a/perl-external/minicpan/modules/02packages.details.txt.gz +++ b/perl-external/minicpan/modules/02packages.details.txt.gz diff --git a/perl-external/modules.txt b/perl-external/modules.txt index 746680927..4c9f79e11 100644 --- a/perl-external/modules.txt +++ b/perl-external/modules.txt @@ -24,6 +24,7 @@ DateTime::Format::HTTP DateTime::Format::ISO8601 DateTime::Format::Pg Email::Address +Email::MIME Email::Send Email::Simple Email::Valid diff --git a/perllib/FixMyStreet/App.pm b/perllib/FixMyStreet/App.pm index 1d584accb..752263d10 100644 --- a/perllib/FixMyStreet/App.pm +++ b/perllib/FixMyStreet/App.pm @@ -278,8 +278,10 @@ sub send_email { from => FixMyStreet->config('CONTACT_EMAIL'), %{ $c->stash }, %$extra_stash_values, - additional_template_paths => - [ $c->cobrand->path_to_email_templates->stringify ] + 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, + ] }; # render the template @@ -292,12 +294,13 @@ sub send_email { # pass the email into mySociety::Email to construct the on the wire 7bit # format - this should probably happen in the transport instead but hohum. - my $email_text = mySociety::Email::construct_email( + my $email_text = mySociety::Locale::in_gb_locale { mySociety::Email::construct_email( { - _unwrapped_body_ => $email->body, # will get line wrapped + _template_ => $email->body, # will get line wrapped + _parameters_ => {}, $email->header_pairs } - ); + ) }; # send the email $c->model('EmailSend')->send($email_text); diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm index 4c7d7438a..1f1086c21 100644 --- a/perllib/FixMyStreet/Cobrand/Default.pm +++ b/perllib/FixMyStreet/Cobrand/Default.pm @@ -90,20 +90,6 @@ sub path_to_web_templates { return FixMyStreet->path_to( 'templates/web', $self->moniker ); } -=head2 path_to_email_templates - - $path = $cobrand->path_to_email_templates( ); - -Returns the path to the templates for this cobrand - by default -"templates/email/$moniker" - -=cut - -sub path_to_email_templates { - my $self = shift; - return FixMyStreet->path_to( 'templates/email', $self->moniker ); -} - =head1 site_restriction Return a site restriction clause and a site key if the cobrand uses a subset of @@ -625,7 +611,7 @@ sub email_host { my $cobrand_moniker_uc = uc( $self->moniker ); my $email_vhost = - mySociety::Config::get("EMAIL_VHOST_$cobrand_moniker_uc") + mySociety::Config::get("EMAIL_VHOST_$cobrand_moniker_uc", '') || mySociety::Config::get("EMAIL_VHOST") || ''; diff --git a/perllib/Problems.pm b/perllib/Problems.pm index 432c89fdc..b742932c1 100644 --- a/perllib/Problems.pm +++ b/perllib/Problems.pm @@ -358,10 +358,10 @@ sub problem_search { my ($search) = @_; my $search_n = 0; $search_n = int($search) if $search =~ /^\d+$/; - my $problems = select_all("select id, council, category, title, name, + my $problems = select_all("select problem.id, council, category, title, problem.name, email, anonymous, cobrand, cobrand_data, created, confirmed, state, service, lastupdate, - whensent, send_questionnaire from problem where (id=? or email ilike - '%'||?||'%' or name ilike '%'||?||'%' or title ilike '%'||?||'%' or + whensent, send_questionnaire from problem, users where problem.user_id = users.id + and (problem.id=? or email ilike '%'||?||'%' or problem.name ilike '%'||?||'%' or title ilike '%'||?||'%' or detail ilike '%'||?||'%' or council like '%'||?||'%' or cobrand_data like '%'||?||'%') $site_restriction order by (state='hidden'),created", $search_n, @@ -380,9 +380,9 @@ sub update_search { my $search_n = 0; $search_n = int($search) if $search =~ /^\d+$/; my $updates = select_all("select comment.*, problem.council, problem.state as problem_state - from comment, problem where problem.id = comment.problem_id + from comment, problem, users where problem.id = comment.problem_id and comment.user_id = users.id and (comment.id=? or - problem_id=? or comment.email ilike '%'||?||'%' or comment.name ilike '%'||?||'%' or + problem_id=? or users.email ilike '%'||?||'%' or comment.name ilike '%'||?||'%' or comment.text ilike '%'||?||'%' or comment.cobrand_data ilike '%'||?||'%') $site_restriction order by (comment.state='hidden'),(problem.state='hidden'),created", $search_n, $search_n, $search, $search, @@ -475,8 +475,8 @@ Uses any site_restriction defined by a cobrand. sub admin_fetch_problem { my ($id) = @_; - my $problem = dbh()->selectall_arrayref("select * from problem - where id=? + my $problem = dbh()->selectall_arrayref("select problem.*, users.email from problem, users + where problem.id=? and users.id = problem.user_id $site_restriction", { Slice=>{} }, $id); return $problem; } @@ -489,9 +489,10 @@ Uses any site_restriction defined by a cobrand. =cut sub admin_fetch_update { my ($id) = @_; - my $update = dbh()->selectall_arrayref("select comment.*, problem.council from comment, problem + my $update = dbh()->selectall_arrayref("select comment.*, problem.council, users.email from comment, problem, users where comment.id=? and problem.id = comment.problem_id + and users.id = comment.user_id $site_restriction", { Slice=>{} }, $id); return $update; } diff --git a/t/app/helpers/send_email_sample.txt b/t/app/helpers/send_email_sample.txt index b5c517246..2fe5272cb 100644 --- a/t/app/helpers/send_email_sample.txt +++ b/t/app/helpers/send_email_sample.txt @@ -23,7 +23,7 @@ From: CONTACT_EMAIL sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. - Yours, - FixMyStreet. + Yours,=20=20 + FixMyStreet.=20= diff --git a/templates/emails/submit-brent b/templates/email/default/submit-brent.txt index f3a9e5bb8..fcddcc8f1 100644 --- a/templates/emails/submit-brent +++ b/templates/email/default/submit-brent.txt @@ -25,16 +25,21 @@ Details: <?=$values['detail']?> Longitude: <?=$values['longitude']?> -<?=$values['closest_address_machine']?>---------- +<?=$values['closest_address']?>---------- Replies to this email will go to the user who submitted the problem. Yours, The FixMyStreet team -[ This message was sent via FixMyStreet, a project of UKCOD, registered charity +This message was sent via FixMyStreet, a project of UKCOD, registered charity number 1076346. If there is a more appropriate email address for messages about <?=$values['category_footer']?>, please let us know by visiting <http://www.fixmystreet.com/contact>. This will help improve the service for local people. We -also welcome any other feedback you may have. ] +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/fixmystreet-for-local-council-websites/ diff --git a/templates/emails/submit-council b/templates/email/default/submit.txt index 21c89119d..2542e786b 100644 --- a/templates/emails/submit-council +++ b/templates/email/default/submit.txt @@ -32,9 +32,14 @@ Replies to this email will go to the user who submitted the problem. Yours, The FixMyStreet team -[ This message was sent via FixMyStreet, a project of UKCOD, registered charity +This message was sent via FixMyStreet, a project of UKCOD, registered charity number 1076346. If there is a more appropriate email address for messages about <?=$values['category_footer']?>, please let us know by visiting <http://www.fixmystreet.com/contact>. This will help improve the service for local people. We -also welcome any other feedback you may have. ] +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/fixmystreet-for-local-council-websites/ diff --git a/templates/email/default/test.txt b/templates/email/default/test.txt index 1200b8726..bfa2c1dd3 100644 --- a/templates/email/default/test.txt +++ b/templates/email/default/test.txt @@ -11,5 +11,5 @@ utf8: 我们应该能够无缝处理UTF8编码 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, - FixMyStreet. +Yours, +FixMyStreet. diff --git a/templates/email/emptyhomes/cy/alert-confirm.txt b/templates/email/emptyhomes/cy/alert-confirm.txt new file mode 100644 index 000000000..9be79a952 --- /dev/null +++ b/templates/email/emptyhomes/cy/alert-confirm.txt @@ -0,0 +1,15 @@ +Subject: Cadarnhau eich rhybudd ar reportemptyhomes.com + +Helo, + +Cliciwch ar y ddolen isod i gadarnhau'r rhybudd yr ydych newydd +ofyn am danysgrifio iddo ar Asiantaeth Tai Gwag: + + [% token_url %] + +Os na allwch glicio ar y ddolen, dylech ei chopïo a'i gludo ym +mar cyfeiriad eich porwr gwe. + +Yn gywir, +Tîm yr Asiantaeth Tai Gwag + diff --git a/templates/email/emptyhomes/cy/partial.txt b/templates/email/emptyhomes/cy/partial.txt new file mode 100644 index 000000000..0692e2548 --- /dev/null +++ b/templates/email/emptyhomes/cy/partial.txt @@ -0,0 +1,16 @@ +Subject: Eich adroddiad newydd ar reportemptyhomes.com + +Helo[% report.name || report.email %], + +Rydym wedi storio'r adroddiad y gwnaethoch ei lwytho i'r Asiantaeth Tai Gwag +drwy gyfrwng +[% report.service %]. I gadarnhau'r manylion sydd gennym, +ac i ychwanegu atynt, ewch i'r URL canlynol: + +[% token_url %] + +Yna, gallwn anfon eich adroddiad at y cyngor. Diolch! + +Yn gywir, +Tîm yr Asiantaeth Tai Gwag + diff --git a/templates/email/emptyhomes/cy/problem-confirm.txt b/templates/email/emptyhomes/cy/problem-confirm.txt new file mode 100644 index 000000000..a9f1b021d --- /dev/null +++ b/templates/email/emptyhomes/cy/problem-confirm.txt @@ -0,0 +1,21 @@ +Subject: Cadarnhau eich adroddiad am eiddo gwag + +Helo [% report.user.name %], + +Cliciwch ar y ddolen isod i gadarnhau'r adroddiad am eiddo gwag +yr ydych newydd ei ychwanegu at y safle: + +[% token_url %] + +Os nad yw eich rhaglen e-bost yn gadael i chi glicio ar y ddolen hon, +dylech ei chopïo a'i gludo i'ch porwr gwe a phwyso'r fysell 'return'. + +Roedd gan eich adroddiad y pwnc: +[% report.title %] + +A'r manylion: +[% report.detail %] + +Yn gywir, +reportemptyhomes.com + diff --git a/templates/email/emptyhomes/cy/submit.txt b/templates/email/emptyhomes/cy/submit.txt new file mode 100644 index 000000000..57c0d58b7 --- /dev/null +++ b/templates/email/emptyhomes/cy/submit.txt @@ -0,0 +1,47 @@ +Subject: Adroddiad am eiddo gwag + +Annwyl Swyddog Eiddo Gwag, + +Dyma gyfeiriad newydd am eiddo gwag yn eich ardal, a wnaed gan ddefnyddiwr +gwefan ReportEmptyHomes.com; dywedwyd wrth ddefnyddiwr y wefan fod yr achos +wedi cael ei gyfeirio atoch. Byddem yn ddiolchgar petaech yn gwneud yr hyn y +gallwch i helpu adfer yr eiddo hwn i'w ddefnyddio eto. Byddwn yn cysylltu â'r +defnyddiwr ymhen mis ac eto ymhen chwe mis ac yn gofyn iddynt beth sydd wedi +digwydd i'r eiddo. + +Hoffwn eich annog chi i ddweud wrthom beth rydych chi wedi'i wneud, a phan y +daw'r eiddo yn ôl mewn defnydd, trwy lenwi diweddariad wrth y cyfeiriad at yr +eiddo ar y wefan: + + <?=$values['url']?> + +Mae hyn yn rhoi adborth defnyddiol i ddefnyddwyr y wefan ac yn helpu iddynt +ddeall pa gamau yr ydych yn eu cymryd. Byddwn yn cynnig cyngor i'r defnyddiwr +ar gamau eraill y gall eu cymryd os nad eir i'r afael â'r eiddo'n llwyddiannus. + +<?=$values['has_photo']?>Os hoffech gael help neu gyngor ar gael eiddo gwag yn +ôl mewn defnydd mae llawer o wybodaeth ddefnyddiol ar wefan yr Asiantaeth Tai +Gwag www.EmptyHomes.com - os oes gennych unrhyw gwestiynau eraill, rhowch alwad +i ni. + +---------- + +Enw: <?=$values['name']?> + +E-bost: <?=$values['email']?> + +<?=$values['phone_line']?>Pwnc: <?=$values['title']?> + +Math o eiddo: <?=$values['category']?> + +Manylion: <?=$values['detail']?> + +<?=$values['closest_address']?>---------- + +Bydd ymatebion i'r neges e-bost hon yn mynd at y defnyddiwr a gyflwynodd yr +adroddiad, os hoffech ofyn am fwy o wybodaeth. + +Yn gywir, +reportemptyhomes.com + + diff --git a/templates/email/emptyhomes/cy/update-confirm.txt b/templates/email/emptyhomes/cy/update-confirm.txt new file mode 100644 index 000000000..655844adf --- /dev/null +++ b/templates/email/emptyhomes/cy/update-confirm.txt @@ -0,0 +1,18 @@ +Subject: Cadarnhewch eich diweddariad ar reportemptyhomes.com + +Helo [% update.user.name %], + +Cliciwch ar y ddolen isod i gadarnhau'r diweddariad yr ydych newydd ei +ysgrifennu: + +[% token_url %] + +Os nad ydych yn gallu clicio ar y ddolen, dylech ei chopïo a'i gludo +ym mar cyfeiriad eich porwr gwe. + +Mae eich diweddariad yn darllen fel a ganlyn: + +[% update.text %] + +Yn gywir, +Tîm yr Asiantaeth Tai Gwag diff --git a/templates/email/emptyhomes/en-gb/alert-confirm.txt b/templates/email/emptyhomes/en-gb/alert-confirm.txt new file mode 100644 index 000000000..31952be28 --- /dev/null +++ b/templates/email/emptyhomes/en-gb/alert-confirm.txt @@ -0,0 +1,14 @@ +Subject: Confirm your alert on reportemptyhomes.com + +Hi, + +Please click on the link below to confirm the alert you just +asked to subscribe to on reportemptyhomes.com: + + [% token_url %] + +If you can't click the link, please copy and paste it to the +address bar of your web browser. + +Yours, +The reportemptyhomes.com team diff --git a/templates/email/emptyhomes/en-gb/contact.txt b/templates/email/emptyhomes/en-gb/contact.txt new file mode 100644 index 000000000..446265517 --- /dev/null +++ b/templates/email/emptyhomes/en-gb/contact.txt @@ -0,0 +1,5 @@ +Subject: reportemptyhomes.com message: [% subject %] + +[% message %] + +[ Sent by contact.cgi on [% host %]. IP address [% ip %] ] diff --git a/templates/email/emptyhomes/en-gb/partial.txt b/templates/email/emptyhomes/en-gb/partial.txt new file mode 100644 index 000000000..0ec2d4b68 --- /dev/null +++ b/templates/email/emptyhomes/en-gb/partial.txt @@ -0,0 +1,14 @@ +Subject: Confirm your report on reportemptyhomes.com + +Hi [% report.name || report.email %], + +To confirm the report you have uploaded to reportemptyhomes.com via +[% report.service %], and to check or add any details, +please visit the following URL: + +[% token_url %] + +Thanks! + +Yours, +The reportemptyhomes.com team diff --git a/templates/email/emptyhomes/en-gb/problem-confirm.txt b/templates/email/emptyhomes/en-gb/problem-confirm.txt new file mode 100644 index 000000000..25d2a0afd --- /dev/null +++ b/templates/email/emptyhomes/en-gb/problem-confirm.txt @@ -0,0 +1,20 @@ +Subject: Confirm your empty property on reportemptyhomes.com + +Hi [% report.user.name %], + +Please click on the link below to confirm the empty property you just +added to reportemptyhomes.com: + +[% 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. + +Your empty property had the title: +[% report.title %] + +And details: +[% report.detail %] + +Yours, +The reportemptyhomes.com team diff --git a/templates/emails/submit-eha b/templates/email/emptyhomes/en-gb/submit.txt index 4bbaed408..4bbaed408 100644 --- a/templates/emails/submit-eha +++ b/templates/email/emptyhomes/en-gb/submit.txt diff --git a/templates/email/emptyhomes/en-gb/update-confirm.txt b/templates/email/emptyhomes/en-gb/update-confirm.txt new file mode 100644 index 000000000..8facbcf07 --- /dev/null +++ b/templates/email/emptyhomes/en-gb/update-confirm.txt @@ -0,0 +1,17 @@ +Subject: Confirm your update on reportemptyhomes.com + +Hi [% update.user.name %], + +Please click on the link below to confirm the update you just wrote: + +[% 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. + +Your update reads: + +[% update.text %] + +Yours, +The reportemptyhomes.com team diff --git a/templates/email/fiksgatami/alert-confirm.txt b/templates/email/fiksgatami/alert-confirm.txt new file mode 100644 index 000000000..7498df2e1 --- /dev/null +++ b/templates/email/fiksgatami/alert-confirm.txt @@ -0,0 +1,14 @@ +Subject: Bekreft din sak på FiksGataMI.no + +Hei, + +Vennligst klikk på lenken under for å bekrefte varslet du +har bedt om å abonnere på FiksGataMi: + + [% token_url %] + +Hvis du ikke kan klikke på lenken, kan du kopiere den i +addressefeltet på dine nettleser. + +Vennlig Hilsen, +FiksGataMi-gruppen diff --git a/templates/email/fiksgatami/contact.txt b/templates/email/fiksgatami/contact.txt new file mode 100644 index 000000000..59a778ad5 --- /dev/null +++ b/templates/email/fiksgatami/contact.txt @@ -0,0 +1,5 @@ +Subject: FMS message: [% subject %] + +[% message %] + +[ Sent by contact.cgi on [% host %]. IP address [% ip %] ] diff --git a/templates/email/fiksgatami/partial.txt b/templates/email/fiksgatami/partial.txt new file mode 100644 index 000000000..70359e265 --- /dev/null +++ b/templates/email/fiksgatami/partial.txt @@ -0,0 +1,14 @@ +Subject: Bekreft din rapport på FiksGataMi + +Hei [% report.name || report.email %], + +For å bekrefte rapporten du har lastet opp til FiksGatami via +[% report.service %], og for å sjekke eller legge til litt detaljer, +besøk følgende URL: + +[% token_url %] + +Takk! + +Vennlig hilsen, +FiksGataMi-gruppen diff --git a/templates/email/fiksgatami/problem-confirm.txt b/templates/email/fiksgatami/problem-confirm.txt new file mode 100644 index 000000000..046903270 --- /dev/null +++ b/templates/email/fiksgatami/problem-confirm.txt @@ -0,0 +1,20 @@ +Subject: Bekreftelse på ny sak lagt til på FiksGataMi.no + +Hei [% report.user.name %], + +Vennligst klikk på linken under for å bekrefte saken du har lagt til +på FiksGataMi: + +[% token_url %] + +Hvis ditt epost program ikke gir deg mulighet til å klikke på linken, +kopier linken inn i nettleseren. + +Din sak hadde følgende tittel: +[% report.title %] + +Med følgende verdier: +[% report.detail %] + +Vennlig hilsen, +FiksGataMi-gruppen diff --git a/templates/email/fiksgatami/submit.txt b/templates/email/fiksgatami/submit.txt new file mode 100644 index 000000000..12c801bbb --- /dev/null +++ b/templates/email/fiksgatami/submit.txt @@ -0,0 +1,41 @@ +Subject: Problemrapport: <?=$values['title']?> + +Til <?=$values['councils_name']?>, + +<?=$values['missing']?><?=$values['multiple']?>En bruker av +FiksGataMi har sendt inn følgende rapport om et lokalt +problem som vi tror trenger deres oppmerksomhet. + +<?=$values['fuzzy']?>, eller for å bidra med en oppdatering om problemet, +vennligst besøk følgende lenke: + + <?=$values['url']?> + +<?=$values['has_photo']?>---------- + +Navn: <?=$values['name']?> + +Epost: <?=$values['email']?> + +<?=$values['phone_line']?><?=$values['category_line']?>Tema: <?=$values['title']?> + +Detajer: <?=$values['detail']?> + +<?=$values['easting_northing']?>Breddegrad: <?=$values['latitude']?> + +Lengegrad: <?=$values['longitude']?> + +<?=$values['closest_address']?>---------- + +Svar på denne eposten går til brukeren som sendte inn problemet. + +Vennlig hilsen, +FiksGataMi-gruppen + +[ Denne meldingen ble sendt inn via FiksGataMi, et prosjekt hos foreningen NUUG. +Hvis det er en mer passende epostadresse for meldinger om +<?=$values['category_footer']?>, vær så snill å gi oss beskjed ved å besøke +<http://www.fiksgatami.no/contact>. +Dette vil bidra til å forbedre tjenesten for lokalbefolkningen. Vi +tar også gjerne imot andre tilbakemeldinger om du har noen. ] + diff --git a/templates/email/fiksgatami/update-confirm.txt b/templates/email/fiksgatami/update-confirm.txt new file mode 100644 index 000000000..4d6d12369 --- /dev/null +++ b/templates/email/fiksgatami/update-confirm.txt @@ -0,0 +1,18 @@ +Subject: Bekreft din oppdatering på FiksGataMi + +Hei [% update.user.name %], + +Vennligst klikk på lenken under for å bekrefte oppdateringen du skrev " +nettopp: + +[% token_url %] + +Hvis du ikke kan klikke på lenken, kopier og lim den inn +i adressefeltet på din nettleser.. + +Din oppdatering inneholder: + +[% update.text %] + +Vennlig hilsen, +FiksGataMi-gruppen |