From: Bernd Bleßmann Date: Tue, 23 Mar 2021 12:09:09 +0000 (+0100) Subject: Verknüpfung zum E-Mail-Journal für Mahnungen. X-Git-Tag: kivitendo-mebil_0.1-0~9^2~401 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=a031b8204ad76801838965d4ed230dc0d4320405;p=kivitendo-erp.git Verknüpfung zum E-Mail-Journal für Mahnungen. --- diff --git a/SL/DN.pm b/SL/DN.pm index 1a615011f..bd002ad65 100644 --- a/SL/DN.pm +++ b/SL/DN.pm @@ -505,6 +505,11 @@ sub send_email { $mail->{attachments} = $form->{DUNNING_PDFS_EMAIL}; } + $query = qq|SELECT id FROM dunning WHERE dunning_id = ?|; + my @ids = selectall_array_query($form, $dbh, $query, $dunning_id); + $mail->{record_id} = \@ids; + $mail->{record_type} = 'dunning'; + $mail->send(); $main::lxdebug->leave_sub(); diff --git a/SL/Mailer.pm b/SL/Mailer.pm index 959416861..a408b03b9 100644 --- a/SL/Mailer.pm +++ b/SL/Mailer.pm @@ -57,6 +57,7 @@ my %type_to_table = ( letter => 'letter', purchase_delivery_order => 'delivery_orders', sales_delivery_order => 'delivery_orders', + dunning => 'dunning', ); sub new { @@ -421,6 +422,9 @@ Mail can be sent from kivitendo via the sendmail command or the smtp protocol. If $self->{journalentry} and either $self->{record_id} or $::form->{id} (checked in this order) exist a record link from record to email journal is created. + It is possible to provide an array reference with more than one id in + $self->{record_id} or $::form->{id}. In this case all records are linked to + the mail. Will fail silently if record_link creation wasn't successful (same behaviour as _store_in_journal).