1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

Attach invoice documents to payment emails

This commit is contained in:
David Bomba 2022-12-15 16:56:53 +11:00
parent a24a051004
commit 269b3cf198

View File

@ -96,8 +96,12 @@ class PaymentEmailEngine extends BaseEmailEngine
$this->setAttachments([['file' => base64_encode($pdf), 'name' => $invoice->numberFormatter().'.pdf']]);
foreach ($invoice->documents as $document) {
$this->setAttachments([['path' => $document->filePath(), 'name' => $document->name, 'mime' => NULL, ]]);
//attach invoice documents also to payments
if ($this->client->getSetting('document_email_attachment') !== false)
{
foreach ($invoice->documents as $document) {
$this->setAttachments([['path' => $document->filePath(), 'name' => $document->name, 'mime' => NULL, ]]);
}
}
});