Skip to content

Commit

Permalink
Merge pull request #26906 from rycks/14.0_fix_join_file_on_sendEmails…
Browse files Browse the repository at this point in the history
…RemindersOnInvoiceDueDate

fix #26862 but on 14.0 where that bug was present
  • Loading branch information
eldy committed Dec 2, 2023
2 parents 1945055 + d6c97bd commit a79e016
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion htdocs/compta/facture/class/facture.class.php
Expand Up @@ -5159,8 +5159,19 @@ public function sendEmailsRemindersOnInvoiceDueDate($nbdays = 0, $paymentmode =
$errors_to = $conf->global->MAIN_MAIL_ERRORS_TO;

$trackid = 'inv'.$tmpinvoice->id;

//join file is asked
$joinFile = [];
$joinFileName = [];
$joinFileMime = [];
if ($arraymessage->joinfiles == 1 && !empty($tmpinvoice->last_main_doc)) {
$joinFile[] = DOL_DATA_ROOT.$tmpinvoice->last_main_doc;
$joinFileName[] = basename($tmpinvoice->last_main_doc);
$joinFileMime[] = dol_mimetype(DOL_DATA_ROOT.$tmpinvoice->last_main_doc);
}

// Mail Creation
$cMailFile = new CMailFile($sendTopic, $to, $from, $sendContent, array(), array(), array(), '', "", 0, 1, $errors_to, '', $trackid, '', '', '');
$cMailFile = new CMailFile($sendTopic, $to, $from, $sendContent, $joinFile, $joinFileMime, $joinFileName, '', "", 0, 1, $errors_to, '', $trackid, '', '', '');

// Sending Mail
if ($cMailFile->sendfile()) {
Expand Down

0 comments on commit a79e016

Please sign in to comment.