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

55 lines
1.5 KiB
PHP
Raw Normal View History

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
*
2023-01-28 23:21:40 +01:00
* @copyright Copyright (c) 2023. 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\Mail\Mailable;
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());
2023-08-07 00:23:13 +02:00
$company = Company::query()->where('company_key', $this->company->company_key)->first();
2021-05-13 15:37:25 +02:00
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()]))
->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
}
}