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:
parent
dff4f762d4
commit
55bb506d4e
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user