diff options
author | Matthew Somerville <matthew@fury.ukcod.org.uk> | 2011-02-22 12:36:31 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@fury.ukcod.org.uk> | 2011-02-22 12:36:31 +0000 |
commit | 71d3ebb75f1bad04decb3970c7652118c852448d (patch) | |
tree | 0b0d544962e261fad56859e159d84dfc8acebac6 | |
parent | aa0611663f2852f48b8a77481bc9d6da406b2cc1 (diff) |
Fix char encoding in emails.
-rwxr-xr-x | bin/send-questionnaires | 4 | ||||
-rwxr-xr-x | bin/send-reports | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/bin/send-questionnaires b/bin/send-questionnaires index 5b0350f29..d3945bf12 100755 --- a/bin/send-questionnaires +++ b/bin/send-questionnaires @@ -63,7 +63,7 @@ foreach my $row (@$unsent) { my @all_councils = split /,|\|/, $row->{council}; my $cobrand = $row->{cobrand}; my $lang = $row->{lang}; - Cobrand::set_lang_and_domain($cobrand, $lang); + Cobrand::set_lang_and_domain($cobrand, $lang, 1); # 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 @@ -76,7 +76,7 @@ foreach my $row (@$unsent) { my %h = map { $_ => $row->{$_} } qw/name title detail category/; $h{created} = Page::prettify_duration($row->{created}, 'week'); - $h{councils} = join(' and ', map { encode_utf8($areas_info->{$_}->{name}) } @councils); + $h{councils} = join(' and ', map { $areas_info->{$_}->{name} } @councils); my $id = dbh()->selectrow_array("select nextval('questionnaire_id_seq');"); dbh()->do('insert into questionnaire (id, problem_id, whensent) diff --git a/bin/send-reports b/bin/send-reports index 580a8114e..84bfb1791 100755 --- a/bin/send-reports +++ b/bin/send-reports @@ -70,7 +70,7 @@ foreach my $row (@$unsent) { # 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}); + 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(); @@ -116,7 +116,7 @@ foreach my $row (@$unsent) { my $council = $row->{council}; $areas_info = mySociety::MaPit::call('areas', $council); - my $name = encode_utf8($areas_info->{$council}->{name}); + 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'); @@ -143,7 +143,7 @@ foreach my $row (@$unsent) { my (@dear, %recips); my $all_confirmed = 1; foreach my $council (@councils) { - my $name = encode_utf8($areas_info->{$council}->{name}); + my $name = $areas_info->{$council}->{name}; push @dear, $name; if ($council == 2330) { # E. Hants have a web service $send_web = 1; @@ -187,7 +187,7 @@ foreach my $row (@$unsent) { : ''; $h{missing} = ''; if ($missing) { - my $name = encode_utf8($areas_info->{$missing}->{name}); + my $name = $areas_info->{$missing}->{name}; $h{missing} = '[ ' . sprintf(_('We realise this problem might be the responsibility of %s; however, we don\'t currently have any contact details for them. If you know of an appropriate contact address, please do get in touch.'), $name) . " ]\n\n"; |