mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Adapt Email entity sending using emailentity
This commit is contained in:
parent
630d591fd4
commit
26577d6aef
@ -23,6 +23,7 @@ use App\Models\Activity;
|
|||||||
use App\Models\Company;
|
use App\Models\Company;
|
||||||
use App\Models\CreditInvitation;
|
use App\Models\CreditInvitation;
|
||||||
use App\Models\InvoiceInvitation;
|
use App\Models\InvoiceInvitation;
|
||||||
|
use App\Models\PurchaseOrderInvitation;
|
||||||
use App\Models\QuoteInvitation;
|
use App\Models\QuoteInvitation;
|
||||||
use App\Models\RecurringInvoiceInvitation;
|
use App\Models\RecurringInvoiceInvitation;
|
||||||
use App\Utils\HtmlEngine;
|
use App\Utils\HtmlEngine;
|
||||||
@ -77,12 +78,16 @@ class EmailEntity implements ShouldQueue
|
|||||||
|
|
||||||
$this->invitation = $invitation;
|
$this->invitation = $invitation;
|
||||||
|
|
||||||
$this->settings = $invitation->contact->client->getMergedSettings();
|
|
||||||
|
|
||||||
$this->entity_string = $this->resolveEntityString();
|
$this->entity_string = $this->resolveEntityString();
|
||||||
|
|
||||||
$this->entity = $invitation->{$this->entity_string};
|
$this->entity = $invitation->{$this->entity_string};
|
||||||
|
|
||||||
|
if($this->entity_string == 'purchase_order')
|
||||||
|
$this->settings = $this->company->settings;
|
||||||
|
else
|
||||||
|
$this->settings = $invitation->contact->client->getMergedSettings();
|
||||||
|
|
||||||
$this->reminder_template = $reminder_template ?: $this->entity->calculateTemplate($this->entity_string);
|
$this->reminder_template = $reminder_template ?: $this->entity->calculateTemplate($this->entity_string);
|
||||||
|
|
||||||
$this->html_engine = new HtmlEngine($invitation);
|
$this->html_engine = new HtmlEngine($invitation);
|
||||||
@ -139,6 +144,8 @@ class EmailEntity implements ShouldQueue
|
|||||||
return 'credit';
|
return 'credit';
|
||||||
} elseif ($this->invitation instanceof RecurringInvoiceInvitation) {
|
} elseif ($this->invitation instanceof RecurringInvoiceInvitation) {
|
||||||
return 'recurring_invoice';
|
return 'recurring_invoice';
|
||||||
|
} elseif($this->invitation instanceof PurchaseOrderInvitation) {
|
||||||
|
return 'purchase_order';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user