1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00

Fixes for Triggered Actions

This commit is contained in:
David Bomba 2021-09-09 17:23:47 +10:00
parent 558c2c42ad
commit 42c27d1cac
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);
$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;
use App\Jobs\Invoice\CreateUbl;
use App\Models\Invoice;
use App\Utils\TempFile;
use App\Utils\Traits\MakesInvoiceHtml;
use Illuminate\Bus\Queueable;

View File

@ -63,8 +63,8 @@ class TriggeredActions extends AbstractService
private function sendEmail()
{
//$reminder_template = $this->invoice->calculateTemplate('invoice');
$reminder_template = 'payment';
$reminder_template = $this->invoice->calculateTemplate('invoice');
//$reminder_template = 'payment';
$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);