diff options
Diffstat (limited to 'perllib/FixMyStreet/SendReport')
-rw-r--r-- | perllib/FixMyStreet/SendReport/Email.pm | 7 | ||||
-rw-r--r-- | perllib/FixMyStreet/SendReport/Zurich.pm | 13 |
2 files changed, 19 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/SendReport/Email.pm b/perllib/FixMyStreet/SendReport/Email.pm index 9fec0ac9c..bac408510 100644 --- a/perllib/FixMyStreet/SendReport/Email.pm +++ b/perllib/FixMyStreet/SendReport/Email.pm @@ -93,6 +93,11 @@ sub send { To => $self->to, From => $self->send_from( $row ), }; + + my $app = FixMyStreet::App->new( cobrand => $cobrand ); + + $cobrand->munge_sendreport_params($app, $row, $h, $params) if $cobrand->can('munge_sendreport_params'); + $params->{Bcc} = $self->bcc if @{$self->bcc}; if (FixMyStreet::Email::test_dmarc($params->{From}[0])) { @@ -100,7 +105,7 @@ sub send { $params->{From} = [ mySociety::Config::get('CONTACT_EMAIL'), $params->{From}[1] ]; } - my $result = FixMyStreet::App->send_email_cron( + my $result = $app->send_email_cron( $params, mySociety::Config::get('CONTACT_EMAIL'), $nomail, diff --git a/perllib/FixMyStreet/SendReport/Zurich.pm b/perllib/FixMyStreet/SendReport/Zurich.pm index 40417b41e..2838440cb 100644 --- a/perllib/FixMyStreet/SendReport/Zurich.pm +++ b/perllib/FixMyStreet/SendReport/Zurich.pm @@ -9,10 +9,21 @@ sub build_recipient_list { # Only one body ever, most of the time with an email endpoint my $body = @{ $self->bodies }[0]; + + # we set external_message (but default to '' in case of race condition e.g. + # Wunsch set, but external_message hasn't yet been filled in. TODO should + # we instead be holding off sending?) if ( $row->external_body ) { $body = FixMyStreet::App->model("DB::Body")->find( { id => $row->external_body } ); $h->{bodies_name} = $body->name; + $h->{external_message} = $row->get_extra_metadata('external_message') || ''; } + $h->{external_message} //= ''; + + my ($west, $nord) = $row->local_coords; + $h->{west} = $west; + $h->{nord} = $nord; + my $body_email = $body->endpoint; my $parent = $body->parent; @@ -39,6 +50,8 @@ sub get_template { $template = 'submit-in-progress.txt'; } elsif ( $row->state eq 'planned' ) { $template = 'submit-feedback-pending.txt'; + } elsif ( $row->state eq 'investigating' ) { + $template = 'submit-external-wish.txt'; } elsif ( $row->state eq 'closed' ) { $template = 'submit-external.txt'; if ( $row->extra->{third_personal} ) { |