X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=inline;f=SL%2FBackgroundJob%2FSelfTest.pm;h=d5811fd0533390569385fa24d023374552cbacd1;hb=8da82ce0e57e5ae5a05f4fec2dea1fb049aadf10;hp=d4465721f169e5a62485bfeebb2ab4135edf2a6e;hpb=b4cc349b7fe50744832261c8b415bd146bde5520;p=kivitendo-erp.git diff --git a/SL/BackgroundJob/SelfTest.pm b/SL/BackgroundJob/SelfTest.pm index d4465721f..d5811fd05 100644 --- a/SL/BackgroundJob/SelfTest.pm +++ b/SL/BackgroundJob/SelfTest.pm @@ -65,7 +65,7 @@ sub run { ); # if (!$self->aggreg->all_passed || $self->config->{send_email_on_success}) { # all_passed is not set or calculated (anymore). it is safe to check only for probs or errors - if ($self->aggreg->has_problems || $self->aggreg->has_errors || $self->config->{send_email_on_success}) { + if ($self->aggreg->failed || $self->config->{send_email_on_success}) { $self->_send_email; } @@ -134,13 +134,14 @@ sub _send_email { $mail->{content_type} = $content_type; $mail->{message} = $$output; - $mail->send; + my $err = $mail->send; + $self->add_errors('Mailer error #1', $err) if $err; + } sub _prepare_report { my ($self) = @_; - my $user = $self->_email_user; my $template = Template->new({ 'INTERPOLATE' => 0, 'EVAL_PERL' => 0, 'ABSOLUTE' => 1, @@ -187,14 +188,4 @@ SL::BackgroundJob::SelfTest - pluggable self testing use SL::BackgroundJob::SelfTest; SL::BackgroundJob::SelfTest->new->run;; -=head1 DESCRIPTION - - - -=head1 FUNCTIONS - -=head1 BUGS - -=head1 AUTHOR - =cut