From a031b8204ad76801838965d4ed230dc0d4320405 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Tue, 23 Mar 2021 13:09:09 +0100 Subject: [PATCH] =?utf8?q?Verkn=C3=BCpfung=20zum=20E-Mail-Journal=20f?= =?utf8?q?=C3=BCr=20Mahnungen.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/DN.pm | 5 +++++ SL/Mailer.pm | 4 ++++ 2 files changed, 9 insertions(+) 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). -- 2.20.1