diff options
Diffstat (limited to 'perllib/FixMyStreet/SendReport/Email.pm')
-rw-r--r-- | perllib/FixMyStreet/SendReport/Email.pm | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/SendReport/Email.pm b/perllib/FixMyStreet/SendReport/Email.pm index 654ed6b3a..f26116bc4 100644 --- a/perllib/FixMyStreet/SendReport/Email.pm +++ b/perllib/FixMyStreet/SendReport/Email.pm @@ -12,6 +12,7 @@ sub build_recipient_list { my $all_confirmed = 1; foreach my $council ( keys %{ $self->councils } ) { + my $contact = FixMyStreet::App->model("DB::Contact")->find( { deleted => 0, area_id => $council, @@ -32,7 +33,13 @@ sub build_recipient_list { $self->unconfirmed_notes->{$council_email}{$row->category} = $note; } - push @{ $self->to }, [ $council_email, $self->councils->{ $council }->{name} ]; + # see something uses council areas but doesn't send to councils so just use a + # generic name here to minimise confusion + if ( $row->cobrand eq 'seesomething' ) { + push @{ $self->to }, [ $council_email, 'See Something, Say Something' ]; + } else { + push @{ $self->to }, [ $council_email, $self->councils->{ $council }->{info}->{name} ]; + } $recips{$council_email} = 1; } @@ -45,7 +52,9 @@ sub get_template { my $template = 'submit.txt'; $template = 'submit-brent.txt' if $row->council eq 2488 || $row->council eq 2237; - my $template_path = FixMyStreet->path_to( "templates", "email", $row->cobrand, $template )->stringify; + my $template_path = FixMyStreet->path_to( "templates", "email", $row->cobrand, $row->lang, $template )->stringify; + $template_path = FixMyStreet->path_to( "templates", "email", $row->cobrand, $template )->stringify + unless -e $template_path; $template_path = FixMyStreet->path_to( "templates", "email", "default", $template )->stringify unless -e $template_path; $template = Utils::read_file( $template_path ); |