add explicit config toggle to disable sendmail

This commit is contained in:
Daniel Friesel 2019-04-13 18:56:06 +02:00
parent 4d413d06a3
commit 13dbcf8761
2 changed files with 3 additions and 2 deletions

View file

@ -583,7 +583,8 @@ qq{select * from pending_mails where email = ? and num_tries > 1;}
$self->helper(
sendmail => sub {
state $sendmail
= Travelynx::Helper::Sendmail->new( config => $self->config );
= Travelynx::Helper::Sendmail->new(
config => ( $self->config->{mail} // {} ) );
}
);

View file

@ -28,7 +28,7 @@ sub custom {
body => encode( 'utf-8', $body ),
);
if ( $self->{config}->{db}->{database} =~ m{travelynx_dev} ) {
if ( $self->{config}->{disabled} ) {
# Do not send mail in dev mode
say "sendmail to ${to}: ${subject}\n\n${body}";