1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-21 17:01:33 +02:00
invoiceninja/app/Mail/DownloadBackup.php

45 lines
1.2 KiB
PHP
Raw Normal View History

2021-05-13 08:16:39 +02:00
<?php
namespace App\Mail;
use App\Models\Company;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
class DownloadBackup extends Mailable
{
// use Queueable, SerializesModels;
public $file_path;
public $company;
public function __construct($file_path, Company $company)
{
$this->file_path = $file_path;
$this->company = $company;
}
/**
* Build the message.
*/
public function build()
{
2021-05-13 15:37:25 +02:00
$company = Company::where('company_key', $this->company->company_key)->first();
2021-05-13 08:16:39 +02:00
return $this->from(config('mail.from.address'), config('mail.from.name'))
->subject(ctrans('texts.download_backup_subject'))
->markdown(
'email.admin.download_files',
[
'url' => $this->file_path,
2021-05-13 15:37:25 +02:00
'logo' => $company->present()->logo,
'whitelabel' => $company->account->isPaid() ? true : false,
'settings' => $company->settings
2021-05-13 08:16:39 +02:00
]
);
}
}