mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-23 20:00:33 -04:00
fixes for custom email templates
This commit is contained in:
parent
c166ef82ff
commit
e01f100407
@ -136,8 +136,8 @@ class NinjaMailerJob implements ShouldQueue
|
|||||||
|
|
||||||
$mailable = $this->nmo->mailable;
|
$mailable = $this->nmo->mailable;
|
||||||
|
|
||||||
/** May need to re-build it here */
|
/** May need to re-build it here @todo explain why we need this? */
|
||||||
if (Ninja::isHosted() && method_exists($mailable, 'build')) {
|
if (Ninja::isHosted() && method_exists($mailable, 'build') && $this->nmo->settings->email_style != "custom") {
|
||||||
$mailable->build();
|
$mailable->build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -675,9 +675,6 @@ class NinjaMailerJob implements ShouldQueue
|
|||||||
*/
|
*/
|
||||||
private function preFlightChecksFail(): bool
|
private function preFlightChecksFail(): bool
|
||||||
{
|
{
|
||||||
|
|
||||||
(new \Modules\Admin\Jobs\Account\EmailQuality($this->nmo, $this->company))->run();
|
|
||||||
|
|
||||||
/* Always send regardless */
|
/* Always send regardless */
|
||||||
if ($this->override) {
|
if ($this->override) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -116,6 +116,7 @@ class EmailPayment implements ShouldQueue
|
|||||||
|
|
||||||
$invoice->invitations->each(function ($invite) use ($email_builder) {
|
$invoice->invitations->each(function ($invite) use ($email_builder) {
|
||||||
|
|
||||||
|
|
||||||
$cloned_mailable = unserialize(serialize($email_builder));
|
$cloned_mailable = unserialize(serialize($email_builder));
|
||||||
|
|
||||||
$nmo = new NinjaMailerObject();
|
$nmo = new NinjaMailerObject();
|
||||||
|
@ -134,10 +134,6 @@ class InvoiceEmailEngine extends BaseEmailEngine
|
|||||||
$this->setAttachments([['file' => base64_encode($pdf), 'name' => $this->invoice->numberFormatter().'.pdf']]);
|
$this->setAttachments([['file' => base64_encode($pdf), 'name' => $this->invoice->numberFormatter().'.pdf']]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// $hash = Str::uuid();
|
|
||||||
// $url = \Illuminate\Support\Facades\URL::temporarySignedRoute('protected_download', now()->addHour(), ['hash' => $hash]);
|
|
||||||
// Cache::put($hash, $url, now()->addHour());
|
|
||||||
|
|
||||||
//attach third party documents
|
//attach third party documents
|
||||||
if ($this->client->getSetting('document_email_attachment') !== false && $this->invoice->company->account->hasFeature(Account::FEATURE_DOCUMENTS)) {
|
if ($this->client->getSetting('document_email_attachment') !== false && $this->invoice->company->account->hasFeature(Account::FEATURE_DOCUMENTS)) {
|
||||||
if ($this->invoice->recurring_invoice()->exists()) {
|
if ($this->invoice->recurring_invoice()->exists()) {
|
||||||
|
@ -99,7 +99,6 @@ class PaymentEmailEngine extends BaseEmailEngine
|
|||||||
->setViewLink('')
|
->setViewLink('')
|
||||||
->setViewText('');
|
->setViewText('');
|
||||||
|
|
||||||
|
|
||||||
if ($this->client->getSetting('pdf_email_attachment') !== false && $this->company->account->hasFeature(Account::FEATURE_PDF_ATTACHMENT)) {
|
if ($this->client->getSetting('pdf_email_attachment') !== false && $this->company->account->hasFeature(Account::FEATURE_PDF_ATTACHMENT)) {
|
||||||
|
|
||||||
$template_in_use = false;
|
$template_in_use = false;
|
||||||
|
@ -561,10 +561,19 @@ class HtmlEngine
|
|||||||
|
|
||||||
$data['$spc_qr_code'] = ['value' => $this->company->present()->getSpcQrCode($this->client->currency()->code, $this->entity->number, $this->entity->balance, $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'company1', $this->settings->custom_value1, $this->client)), 'label' => ''];
|
$data['$spc_qr_code'] = ['value' => $this->company->present()->getSpcQrCode($this->client->currency()->code, $this->entity->number, $this->entity->balance, $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'company1', $this->settings->custom_value1, $this->client)), 'label' => ''];
|
||||||
|
|
||||||
|
if(Ninja::isHosted())
|
||||||
|
$logo = $this->company->present()->logo($this->settings);
|
||||||
|
else
|
||||||
$logo = $this->company->present()->logo_base64($this->settings);
|
$logo = $this->company->present()->logo_base64($this->settings);
|
||||||
|
|
||||||
|
$logo_url = $this->company->present()->logo($this->settings);
|
||||||
|
|
||||||
|
|
||||||
$data['$company.logo'] = ['value' => $logo ?: ' ', 'label' => ctrans('texts.logo')];
|
$data['$company.logo'] = ['value' => $logo ?: ' ', 'label' => ctrans('texts.logo')];
|
||||||
$data['$company_logo'] = &$data['$company.logo'];
|
$data['$company_logo'] = &$data['$company.logo'];
|
||||||
|
|
||||||
|
$data['$company.logo_url'] = ['value' => $logo_url ?: ' ', 'label' => ctrans('texts.logo')];
|
||||||
|
|
||||||
$data['$company1'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'company1', $this->settings->custom_value1, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'company1')];
|
$data['$company1'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'company1', $this->settings->custom_value1, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'company1')];
|
||||||
$data['$company2'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'company2', $this->settings->custom_value2, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'company2')];
|
$data['$company2'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'company2', $this->settings->custom_value2, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'company2')];
|
||||||
$data['$company3'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'company3', $this->settings->custom_value3, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'company3')];
|
$data['$company3'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'company3', $this->settings->custom_value3, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'company3')];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user