diff options
Diffstat (limited to 'perllib/FixMyStreet/SendReport')
-rw-r--r-- | perllib/FixMyStreet/SendReport/Email.pm | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/SendReport/Email.pm b/perllib/FixMyStreet/SendReport/Email.pm index 9006e2f11..21f8f7ca0 100644 --- a/perllib/FixMyStreet/SendReport/Email.pm +++ b/perllib/FixMyStreet/SendReport/Email.pm @@ -33,14 +33,24 @@ sub build_recipient_list { $self->unconfirmed_notes->{$body_email}{$row->category} = $note; } + my $body_name = $body->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 }, [ $body_email, 'See Something, Say Something' ]; + $body_name = 'See Something, Say Something'; + } + + my @emails; + # allow multiple emails per contact + if ( $body_email =~ /,/ ) { + @emails = split(/,/, $body_email); } else { - push @{ $self->to }, [ $body_email, $body->name ]; + @emails = ( $body_email ); + } + for my $email ( @emails ) { + push @{ $self->to }, [ $email, $body_name ]; + $recips{$email} = 1; } - $recips{$body_email} = 1; } return () unless $all_confirmed; |