aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Script/Questionnaires.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2018-09-12 13:25:34 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2018-09-13 15:12:12 +0100
commit90da7da99ceddc57f70e678a6f56579f1c89197f (patch)
tree4b2d9919ea50526f2daa34daabfff4f4b1df506e /perllib/FixMyStreet/Script/Questionnaires.pm
parent847ea6f773ddb5ba921ee1d9f1a0db4799687b1d (diff)
Add hook for per-row questionnaire override.
Diffstat (limited to 'perllib/FixMyStreet/Script/Questionnaires.pm')
-rw-r--r--perllib/FixMyStreet/Script/Questionnaires.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/Script/Questionnaires.pm b/perllib/FixMyStreet/Script/Questionnaires.pm
index 5fc01512d..d89f1bcf8 100644
--- a/perllib/FixMyStreet/Script/Questionnaires.pm
+++ b/perllib/FixMyStreet/Script/Questionnaires.pm
@@ -50,7 +50,10 @@ sub send_questionnaires_period {
# Not all cobrands send questionnaires
next unless $cobrand->send_questionnaires;
- if ($row->is_from_abuser || !$row->user->email_verified) {
+ # Cobrands can also override sending per row if they wish
+ my $cobrand_send = $cobrand->call_hook('send_questionnaire', $row) // 1;
+
+ if ($row->is_from_abuser || !$row->user->email_verified || !$cobrand_send) {
$row->update( { send_questionnaire => 0 } );
next;
}