aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2017-04-13 21:28:10 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2017-04-13 21:28:10 +0100
commit6ef5055f5d918f0d3f7d078d144e8734b9d0b2fa (patch)
tree690619713f3a0987e10c55d2bd60902ca2b37f60
parentef6ffbdbfa562dca1825a0abc06afb0e52509737 (diff)
parentefe6ac273fa3ec9edc48e7d196d59f2e9a82a224 (diff)
Merge branch '1374-better-send-method-lookup'
-rw-r--r--perllib/FixMyStreet/Cobrand/Default.pm12
1 files changed, 5 insertions, 7 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm
index 6d9f38d78..ac70fff08 100644
--- a/perllib/FixMyStreet/Cobrand/Default.pm
+++ b/perllib/FixMyStreet/Cobrand/Default.pm
@@ -873,13 +873,11 @@ sub get_body_sender {
# look up via category
my $contact = $body->contacts->search( { category => $category } )->first;
- if ( $body->can_be_devolved ) {
- if ( $contact->send_method ) {
- return { method => $contact->send_method, config => $contact, contact => $contact };
- } else {
- return { method => $body->send_method, config => $body, contact => $contact };
- }
- } elsif ( $body->send_method ) {
+ if ( $body->can_be_devolved && $contact->send_method ) {
+ return { method => $contact->send_method, config => $contact, contact => $contact };
+ }
+
+ if ( $body->send_method ) {
return { method => $body->send_method, config => $body, contact => $contact };
}