Skip to content
Code-Schnipsel Gruppen Projekte
Commit c6eb2306 erstellt von Patrick Müller's avatar Patrick Müller
Dateien durchsuchen

Merge branch 'master' into 1.2

Übergeordnete 4add0cf1 24ecdd9f
No related branches found
No related tags found
Keine zugehörigen Merge Requests gefunden
......@@ -203,6 +203,11 @@ public static function sendPdfViaMail(
$pdfFile = $OutputTemplate->getPDFDocument()->createPDF();
// Re-name PDF
$pdfDir = QUI::getPackage('quiqqer/erp')->getVarDir();
$mailFile = $pdfDir.$OutputProvider::getDownloadFileName($entityId).'.pdf';
\rename($pdfFile, $mailFile);
if (empty($recipientEmail) || !QUI\Utils\Security\Orthos::checkMailSyntax($recipientEmail)) {
$recipientEmail = $OutputProvider::getEmailAddress($entityId);
}
......@@ -218,7 +223,7 @@ public static function sendPdfViaMail(
$Mailer = new QUI\Mail\Mailer();
$Mailer->addRecipient($recipientEmail);
$Mailer->addAttachment($pdfFile);
$Mailer->addAttachment($mailFile);
if (!empty($mailSubject)) {
$Mailer->setSubject($mailSubject);
......@@ -237,8 +242,8 @@ public static function sendPdfViaMail(
QUI::getEvents()->fireEvent('quiqqerErpOutputSendMail', [$entityId, $entityType, $recipientEmail]);
// Delete PDF file after send
if (\file_exists($pdfFile)) {
\unlink($pdfFile);
if (\file_exists($mailFile)) {
\unlink($mailFile);
}
}
......
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren