1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-14 15:13:29 +01:00
invoiceninja/app/Mail/DownloadBackup.php

46 lines
1.3 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', ['company' => $company->present()->name()]))
2021-05-13 08:16:39 +02:00
->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,
'greeting' => $company->present()->name(),
2021-05-13 08:16:39 +02:00
]
);
}
}