2021-05-13 08:16:39 +02:00
|
|
|
<?php
|
2021-06-09 17:09:46 +02:00
|
|
|
|
2021-05-17 15:15:46 +02:00
|
|
|
/**
|
|
|
|
* Invoice Ninja (https://invoiceninja.com).
|
|
|
|
*
|
|
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
|
|
*
|
2022-04-27 05:20:41 +02:00
|
|
|
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
|
2021-05-17 15:15:46 +02:00
|
|
|
*
|
2021-06-16 08:58:16 +02:00
|
|
|
* @license https://www.elastic.co/licensing/elastic-license
|
2021-05-17 15:15:46 +02:00
|
|
|
*/
|
2021-05-13 08:16:39 +02:00
|
|
|
|
|
|
|
namespace App\Mail;
|
|
|
|
|
|
|
|
use App\Models\Company;
|
|
|
|
use Illuminate\Bus\Queueable;
|
|
|
|
use Illuminate\Mail\Mailable;
|
|
|
|
use Illuminate\Queue\SerializesModels;
|
2021-12-17 12:11:36 +01:00
|
|
|
use Illuminate\Support\Facades\App;
|
2021-05-13 08:16:39 +02:00
|
|
|
|
|
|
|
class DownloadBackup extends Mailable
|
|
|
|
{
|
|
|
|
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-12-17 12:11:36 +01:00
|
|
|
App::setLocale($this->company->getLocale());
|
2022-06-21 11:57:17 +02:00
|
|
|
|
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'))
|
2021-06-09 17:09:46 +02:00
|
|
|
->subject(ctrans('texts.download_backup_subject', ['company' => $company->present()->name()]))
|
2022-06-21 11:57:17 +02:00
|
|
|
->text('email.admin.download_files_text', [
|
|
|
|
'url' => $this->file_path,
|
2022-03-04 03:08:18 +01:00
|
|
|
])
|
2021-06-09 17:09:46 +02:00
|
|
|
->view('email.admin.download_files', [
|
|
|
|
'url' => $this->file_path,
|
|
|
|
'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
|
|
|
}
|
|
|
|
}
|