aboutsummaryrefslogtreecommitdiffstats
path: root/perllib
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2018-09-13 15:25:36 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2018-09-13 15:25:36 +0100
commita7ef8f35012657eb162a507d6ea897d779cb672f (patch)
tree637e65f1ab9cf75b1def41b1d3e34982fb96918d /perllib
parent9e5595755c912dfa8ae020253668b29f48494e23 (diff)
parent90da7da99ceddc57f70e678a6f56579f1c89197f (diff)
Merge branch 'questionnaire-hooking'
Diffstat (limited to 'perllib')
-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;
}