aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/SendReport/Email.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2017-07-14 16:25:31 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2017-07-14 16:25:31 +0100
commit8c3f0fbfb4bcd33fa8dbc93c2ecb8e0f25ebf383 (patch)
tree0b596b32bc9248d10e6f4409e39d3285e957d40a /perllib/FixMyStreet/SendReport/Email.pm
parent298db521933eb65591fafa218e78f5f4cdb547ad (diff)
parent426bc926a422af21ff39cebed836d34e46238500 (diff)
Merge branch 'issues/forcouncils/192-unused-categories'
Diffstat (limited to 'perllib/FixMyStreet/SendReport/Email.pm')
-rw-r--r--perllib/FixMyStreet/SendReport/Email.pm7
1 files changed, 3 insertions, 4 deletions
diff --git a/perllib/FixMyStreet/SendReport/Email.pm b/perllib/FixMyStreet/SendReport/Email.pm
index 28f3411d0..eefb14553 100644
--- a/perllib/FixMyStreet/SendReport/Email.pm
+++ b/perllib/FixMyStreet/SendReport/Email.pm
@@ -12,15 +12,14 @@ sub build_recipient_list {
my $all_confirmed = 1;
foreach my $body ( @{ $self->bodies } ) {
- my $contact = $row->result_source->schema->resultset("Contact")->find( {
- deleted => 0,
+ my $contact = $row->result_source->schema->resultset("Contact")->not_deleted->find( {
body_id => $body->id,
category => $row->category
} );
- my ($body_email, $confirmed, $note) = ( $contact->email, $contact->confirmed, $contact->note );
+ my ($body_email, $state, $note) = ( $contact->email, $contact->state, $contact->note );
- unless ($confirmed) {
+ unless ($state eq 'confirmed') {
$all_confirmed = 0;
$note = 'Body ' . $row->bodies_str . ' deleted'
unless $note;