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

Attach XInvoice to email

This commit is contained in:
Lars Kusch 2023-04-03 21:18:20 +02:00
parent dff4f762d4
commit 55bb506d4e

View File

@ -18,6 +18,7 @@ use App\Services\PdfMaker\Designs\Utilities\DesignHelpers;
use App\Utils\HtmlEngine;
use App\Utils\Ninja;
use Illuminate\Mail\Mailable;
use Illuminate\Support\Facades\Storage;
class TemplateEmail extends Mailable
{
@ -152,6 +153,11 @@ class TemplateEmail extends Mailable
$this->attachData($ubl_string, $this->invitation->invoice->getFileName('xml'));
}
}
if ($this->invitation && $this->invitation->invoice && $company->use_xinvoice && $this->company->account->hasFeature(Account::FEATURE_PDF_ATTACHMENT)) {
$this->invitation->invoice->service()->getXInvoice($this->invitation->contact);
$disk = config('filesystems.default');
$this->attach(Storage::disk($disk)->path($this->invitation->invoice->client->xinvoice_filepath($this->invitation->invoice->invitations->first()) . $this->invitation->invoice->getFileName("xml")));
}
return $this;
}