Merge pull request #6611 from turbo124/v5-develop

Fixes for Triggered Actions
This commit is contained in:
David Bomba 2021-09-09 17:24:05 +10:00 committed by GitHub
commit 985ed97da6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 3 deletions

View File

@ -127,7 +127,10 @@ class TemplateEmail extends Mailable
$ubl_string = CreateUbl::dispatchNow($this->invitation->invoice); $ubl_string = CreateUbl::dispatchNow($this->invitation->invoice);
$this->attachData($ubl_string, $this->invitation->invoice->getFileName('xml')); nlog($ubl_string);
if($ubl_string)
$this->attachData($ubl_string, $this->invitation->invoice->getFileName('xml'));
} }

View File

@ -11,6 +11,8 @@
namespace App\Notifications; namespace App\Notifications;
use App\Jobs\Invoice\CreateUbl;
use App\Models\Invoice;
use App\Utils\TempFile; use App\Utils\TempFile;
use App\Utils\Traits\MakesInvoiceHtml; use App\Utils\Traits\MakesInvoiceHtml;
use Illuminate\Bus\Queueable; use Illuminate\Bus\Queueable;

View File

@ -63,8 +63,8 @@ class TriggeredActions extends AbstractService
private function sendEmail() private function sendEmail()
{ {
//$reminder_template = $this->invoice->calculateTemplate('invoice'); $reminder_template = $this->invoice->calculateTemplate('invoice');
$reminder_template = 'payment'; //$reminder_template = 'payment';
$this->invoice->invitations->load('contact.client.country', 'invoice.client.country', 'invoice.company')->each(function ($invitation) use ($reminder_template) { $this->invoice->invitations->load('contact.client.country', 'invoice.client.country', 'invoice.company')->each(function ($invitation) use ($reminder_template) {
EmailEntity::dispatch($invitation, $this->invoice->company, $reminder_template); EmailEntity::dispatch($invitation, $this->invoice->company, $reminder_template);