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

Remove prefix from document pdf

This commit is contained in:
David Bomba 2022-12-15 08:32:11 +11:00
parent 20ea1a3cdb
commit 3e04be5d1d
2 changed files with 5 additions and 2 deletions

View File

@ -130,7 +130,7 @@ class InvoiceEmailEngine extends BaseEmailEngine
$pdf = ((new CreateRawPdf($this->invitation, $this->invitation->company->db))->handle());
$this->setAttachments([['file' => base64_encode($pdf), 'name' => ctrans('texts.invoice') . " " .$this->invoice->numberFormatter().'.pdf']]);
$this->setAttachments([['file' => base64_encode($pdf), 'name' => $this->invoice->numberFormatter().'.pdf']]);
}
//attach third party documents

View File

@ -118,7 +118,10 @@ class TemplateEmail extends Mailable
'logo' => $this->company->present()->logo($settings),
]);
foreach ($this->build_email->getAttachments() as $file) {
nlog($this->build_email->getAttachments());
foreach (array_reverse($this->build_email->getAttachments()) as $file) {
if(array_key_exists('file', $file))
$this->attachData(base64_decode($file['file']), $file['name']);
else