diff options
author | Edmund von der Burg <evdb@mysociety.org> | 2011-02-09 21:27:23 +0000 |
---|---|---|
committer | Edmund von der Burg <evdb@mysociety.org> | 2011-02-09 21:27:23 +0000 |
commit | b478998608aebeb502a2753c82d2d00ade5a392f (patch) | |
tree | 54a7abd08a8ddf2b58f866a1dbf7b70bebf12825 /perllib/FixMyStreet/Alert.pm | |
parent | 7fa3d36e8a1d245e55a1d6100e61ca88b43feb5b (diff) |
Add problem state to alert-update emails
Closes #77
Diffstat (limited to 'perllib/FixMyStreet/Alert.pm')
-rw-r--r-- | perllib/FixMyStreet/Alert.pm | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Alert.pm b/perllib/FixMyStreet/Alert.pm index 9996f03c8..b9c124741 100644 --- a/perllib/FixMyStreet/Alert.pm +++ b/perllib/FixMyStreet/Alert.pm @@ -135,6 +135,13 @@ sub email_alerts ($) { # 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($row->{alert_cobrand})); + + # create problem status message for the templates + $data{state_message} = + $row->{state} eq 'fixed' + ? _("This report is currently marked as fixed.") + : _("This report is currently marked as open."); + dbh()->do('insert into alert_sent (alert_id, parameter) values (?,?)', {}, $row->{alert_id}, $row->{item_id}); if ($last_alert_id && $last_alert_id != $row->{alert_id}) { _send_aggregated_alert_email(%data); |