1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-05 18:52:44 +01:00

Fixes for pdf attachment to invoices

This commit is contained in:
David Bomba 2020-12-03 09:26:46 +11:00
parent bc0a925f39
commit 53c2db072f
4 changed files with 6 additions and 5 deletions

View File

@ -25,7 +25,7 @@ class BaseEmailEngine implements EngineInterface
public $template_style;
public $attachments;
public $attachments = [];
public $link;
@ -83,7 +83,8 @@ class BaseEmailEngine implements EngineInterface
public function setAttachments($attachments)
{
$this->attachments = $attachments;
$this->attachments = array_merge($this->getAttachments(), $attachments);
return $this;
}

View File

@ -88,7 +88,7 @@ class CreditEmailEngine extends BaseEmailEngine
->setViewText(ctrans('texts.view_credit'));
if ($this->client->getSetting('pdf_email_attachment') !== false) {
$this->setAttachments($invitation->pdf_file_path());
$this->setAttachments([$this->credit->pdf_file_path()]);
}
return $this;

View File

@ -97,7 +97,7 @@ class InvoiceEmailEngine extends BaseEmailEngine
->setViewText(ctrans('texts.view_invoice'));
if ($this->client->getSetting('pdf_email_attachment') !== false) {
$this->setAttachments($this->invoice->pdf_file_path());
$this->setAttachments([$this->invoice->pdf_file_path()]);
}
return $this;

View File

@ -88,7 +88,7 @@ class QuoteEmailEngine extends BaseEmailEngine
->setViewText(ctrans('texts.view_quote'));
if ($this->client->getSetting('pdf_email_attachment') !== false) {
$this->setAttachments($this->invitation->pdf_file_path());
$this->setAttachments([$this->invitation->pdf_file_path()]);
}
return $this;