Revision 6430257e
Von Jan Büren vor fast 2 Jahren hinzugefügt
SL/BackgroundJob/SelfTest.pm | ||
---|---|---|
44 | 44 |
$self->aggreg(TAP::Parser::Aggregator->new); |
45 | 45 |
|
46 | 46 |
$self->modules(split /\s+/, $self->config->{modules}); |
47 |
$self->modules($self->{options}->{modules}) if $self->{options}->{modules}; |
|
47 | 48 |
} |
48 | 49 |
|
49 | 50 |
sub run { |
50 |
my $self = shift; |
|
51 |
my $db_obj = shift; |
|
51 |
my $self = shift; |
|
52 |
my $db_obj = shift; |
|
53 |
|
|
54 |
# get custom options (module list || alternate email) |
|
55 |
$self->{options} = $db_obj->data_as_hash; |
|
52 | 56 |
$self->setup; |
53 | 57 |
|
54 | 58 |
return 1 unless $self->modules; |
55 | 59 |
|
56 | 60 |
# set additional mail |
57 |
my $options = $db_obj->data_as_hash; |
|
58 |
$self->additional_email($options->{email}) if $options->{email} =~ m/(\S+)@(\S+)$/; |
|
61 |
$self->additional_email($self->{options}->{email}) if $self->{options}->{email} =~ m/(\S+)@(\S+)$/; |
|
59 | 62 |
|
60 | 63 |
foreach my $module ($self->modules) { |
61 | 64 |
$self->run_module($module); |
... | ... | |
130 | 133 |
|
131 | 134 |
my $user = $self->_email_user; |
132 | 135 |
my $email = $user ? $user->get_config_value('email') : undef; |
133 |
|
|
136 |
my $email ||= $self->{options}->{mail_to}; |
|
134 | 137 |
return unless $email; |
135 | 138 |
|
136 | 139 |
$email .= $self->additional_email ? ',' . $self->additional_email : ''; |
Auch abrufbar als: Unified diff
SelfTest um Parameter von data erweitert.
Damit kann Module und E-Mail-Adressen überlagert werden.
Die Einträge im Datenfeld des Hintergrund-Jobs nach YAML Konvention:
modules: Proccess
mail_to: jan@kivitendo-premium.de
Somit ist es möglich unterschiedliche Test-Ergebnisse an unterschiedliche
E-Mail-Adressen zu schicken, wenn man verschiede Jobs dafür einrichtet