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

52 lines
1.3 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
*
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
*
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;
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-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()]))
->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
}
}