diff options
author | Daniel Friesel <derf@finalrewind.org> | 2019-04-13 17:09:10 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2019-04-13 17:09:10 +0200 |
commit | ee53b8f37e8b87ae27bd04086f9a1c04922af33e (patch) | |
tree | a41fa2402f325fe00493315549124a98233e6037 /lib/Travelynx/Helper/Sendmail.pm | |
parent | 6dc92bd88a78d4ab427af407d838d011c52456e2 (diff) |
Pass config to sendmail helper
Diffstat (limited to 'lib/Travelynx/Helper/Sendmail.pm')
-rw-r--r-- | lib/Travelynx/Helper/Sendmail.pm | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Travelynx/Helper/Sendmail.pm b/lib/Travelynx/Helper/Sendmail.pm index 09c8a0d..19e7d05 100644 --- a/lib/Travelynx/Helper/Sendmail.pm +++ b/lib/Travelynx/Helper/Sendmail.pm @@ -10,9 +10,9 @@ use Email::Sender::Simple qw(try_to_sendmail); use Email::Simple; sub new { - my ($class) = @_; + my ( $class, %opt ) = @_; - return bless( {}, $class ); + return bless( \%opt, $class ); } sub custom { @@ -28,7 +28,7 @@ sub custom { body => encode( 'utf-8', $body ), ); - if ( $self->app->config->{db}->{database} =~ m{travelynx_dev} ) { + if ( $self->{config}->{db}->{database} =~ m{travelynx_dev} ) { # Do not send mail in dev mode say "sendmail to ${to}: ${subject}\n\n${body}"; |