aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/EmailSend.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/EmailSend.pm')
-rw-r--r--perllib/FixMyStreet/EmailSend.pm9
1 files changed, 8 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/EmailSend.pm b/perllib/FixMyStreet/EmailSend.pm
index 1c6e2cf7a..09f434931 100644
--- a/perllib/FixMyStreet/EmailSend.pm
+++ b/perllib/FixMyStreet/EmailSend.pm
@@ -55,7 +55,7 @@ if ( FixMyStreet->test_mode ) {
push @$mailer_args, username => $username, password => $password
if $username && $password;
$args = {
- mailer => 'FixMyStreet::EmailSend::DoNotReply',
+ mailer => 'FixMyStreet::EmailSend::Variable',
mailer_args => $mailer_args,
};
} else {
@@ -67,5 +67,12 @@ sub new {
my ($cls, $hash) = @_;
$hash ||= {};
my %args = ( %$args, %$hash );
+
+ my $sender = delete($args{env_from});
+ if ($sender) {
+ $args{mailer_args} = [ @{$args{mailer_args}} ] if $args{mailer_args};
+ push @{$args{mailer_args}}, env_from => $sender;
+ }
+
return Email::Send->new(\%args);
}