mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for mailable
This commit is contained in:
parent
87c000a3e1
commit
90ee9a4ca6
@ -1,18 +1,23 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* Invoice Ninja (https://invoiceninja.com).
|
||||||
|
*
|
||||||
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
|
*
|
||||||
|
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
|
*
|
||||||
|
* @license https://opensource.org/licenses/AAL
|
||||||
|
*/
|
||||||
|
|
||||||
namespace App\Mail;
|
namespace App\Mail;
|
||||||
|
|
||||||
use App\Models\Company;
|
use App\Models\Company;
|
||||||
use App\Utils\Traits\MakesInvoiceHtml;
|
|
||||||
use Illuminate\Bus\Queueable;
|
use Illuminate\Bus\Queueable;
|
||||||
use Illuminate\Mail\Mailable;
|
use Illuminate\Mail\Mailable;
|
||||||
use Illuminate\Queue\SerializesModels;
|
use Illuminate\Queue\SerializesModels;
|
||||||
use Illuminate\Support\Facades\File;
|
|
||||||
|
|
||||||
class DownloadBackup extends Mailable
|
class DownloadBackup extends Mailable
|
||||||
{
|
{
|
||||||
// use Queueable, SerializesModels;
|
|
||||||
use MakesInvoiceHtml;
|
|
||||||
|
|
||||||
public $file_path;
|
public $file_path;
|
||||||
|
|
||||||
@ -30,20 +35,19 @@ class DownloadBackup extends Mailable
|
|||||||
*/
|
*/
|
||||||
public function build()
|
public function build()
|
||||||
{
|
{
|
||||||
$template = File::get(resource_path('views/email/admin/download_files.blade.php'));
|
|
||||||
|
|
||||||
$company = Company::where('company_key', $this->company->company_key)->first();
|
$company = Company::where('company_key', $this->company->company_key)->first();
|
||||||
|
|
||||||
$view = $this->renderView($template, [
|
return $this->from(config('mail.from.address'), config('mail.from.name'))
|
||||||
|
->subject(ctrans('texts.download_backup_subject', ['company' => $company->present()->name()]))
|
||||||
|
->markdown(
|
||||||
|
'email.admin.download_files',
|
||||||
|
[
|
||||||
'url' => $this->file_path,
|
'url' => $this->file_path,
|
||||||
'logo' => $company->present()->logo,
|
'logo' => $company->present()->logo,
|
||||||
'whitelabel' => $company->account->isPaid() ? true : false,
|
'whitelabel' => $company->account->isPaid() ? true : false,
|
||||||
'settings' => $company->settings,
|
'settings' => $company->settings,
|
||||||
'greeting' => $company->present()->name(),
|
'greeting' => $company->present()->name(),
|
||||||
]);
|
]
|
||||||
|
);
|
||||||
return $this->from(config('mail.from.address'), config('mail.from.name'))
|
|
||||||
->subject(ctrans('texts.download_backup_subject', ['company' => $company->present()->name()]))
|
|
||||||
->html($view);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user