From 973bdfcb35ed03825de4878949f81da3d454a90d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Wed, 9 Jun 2021 16:47:11 +0200 Subject: [PATCH] app/Mail/Import/ImportCompleted.php --- app/Jobs/Import/CSVImport.php | 2 +- app/Mail/Import/ImportCompleted.php | 19 ++++++++++++++++--- .../views/email/import/completed.blade.php | 7 ++++--- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/app/Jobs/Import/CSVImport.php b/app/Jobs/Import/CSVImport.php index 01dbaf371856..e273815fb705 100644 --- a/app/Jobs/Import/CSVImport.php +++ b/app/Jobs/Import/CSVImport.php @@ -133,7 +133,7 @@ class CSVImport implements ShouldQueue { ]; $nmo = new NinjaMailerObject; - $nmo->mailable = new ImportCompleted( $data ); + $nmo->mailable = new ImportCompleted($this->company, $data); $nmo->company = $this->company; $nmo->settings = $this->company->settings; $nmo->to_user = $this->company->owner(); diff --git a/app/Mail/Import/ImportCompleted.php b/app/Mail/Import/ImportCompleted.php index 8396fda29903..1d3220ef0e87 100644 --- a/app/Mail/Import/ImportCompleted.php +++ b/app/Mail/Import/ImportCompleted.php @@ -1,4 +1,5 @@ company = $company; + $this->data = $data; } @@ -38,7 +45,13 @@ class ImportCompleted extends Mailable */ public function build() { - return $this->from(config('mail.from.address'), config('mail.from.name')) - ->view('email.import.completed', $this->data); + $data = array_merge($this->data, [ + 'logo' => $this->company->present()->logo(), + 'settings' => $this->company->settings, + ]); + + return $this + ->from(config('mail.from.address'), config('mail.from.name')) + ->view('email.import.completed', $data); } } diff --git a/resources/views/email/import/completed.blade.php b/resources/views/email/import/completed.blade.php index 9824dc60ffae..4de8fa9dd289 100644 --- a/resources/views/email/import/completed.blade.php +++ b/resources/views/email/import/completed.blade.php @@ -1,6 +1,6 @@ -@component('email.template.admin-light', ['logo' => 'https://www.invoiceninja.com/wp-content/uploads/2015/10/logo-white-horizontal-1.png', 'settings' => $settings]) +@component('email.template.admin', ['logo' => $logo, 'settings' => $settings])
-

Import completed

+

{{ ctrans('texts.import_complete') }}

Hello, here is the output of your recent import job.

If your logo imported correctly it will display below. If it didn't import, you'll need to reupload your logo

@@ -98,7 +98,8 @@ {{ ctrans('texts.account_login')}} -

{{ ctrans('texts.email_signature')}}
{{ ctrans('texts.email_from') }}

+

{{ ctrans('texts.email_signature')}}

+

{{ ctrans('texts.email_from') }}

@endcomponent