2020-02-17 10:37:44 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Mail;
|
|
|
|
|
2020-02-24 11:15:30 +01:00
|
|
|
use App\Models\Company;
|
2020-02-17 10:37:44 +01:00
|
|
|
use Illuminate\Bus\Queueable;
|
|
|
|
use Illuminate\Mail\Mailable;
|
|
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
|
|
|
|
class DownloadInvoices extends Mailable
|
|
|
|
{
|
2021-02-11 13:35:46 +01:00
|
|
|
// use Queueable, SerializesModels;
|
2020-02-17 10:37:44 +01:00
|
|
|
|
|
|
|
public $file_path;
|
|
|
|
|
2020-02-24 11:15:30 +01:00
|
|
|
public $company;
|
|
|
|
|
|
|
|
public function __construct($file_path, Company $company)
|
2020-02-17 10:37:44 +01:00
|
|
|
{
|
|
|
|
$this->file_path = $file_path;
|
2020-02-24 11:15:30 +01:00
|
|
|
|
|
|
|
$this->company = $company;
|
2020-02-17 10:37:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Build the message.
|
|
|
|
*
|
|
|
|
* @return $this
|
2020-10-28 11:10:49 +01:00
|
|
|
* @throws \Laracasts\Presenter\Exceptions\PresenterException
|
2020-02-17 10:37:44 +01:00
|
|
|
*/
|
|
|
|
public function build()
|
|
|
|
{
|
2020-12-03 12:00:34 +01:00
|
|
|
return $this->from(config('mail.from.address'), config('mail.from.name'))
|
2021-02-02 06:11:33 +01:00
|
|
|
->subject(ctrans('texts.download_files'))
|
|
|
|
->markdown(
|
|
|
|
'email.admin.download_files',
|
|
|
|
[
|
|
|
|
'url' => $this->file_path,
|
|
|
|
'logo' => $this->company->present()->logo,
|
|
|
|
'whitelabel' => $this->company->account->isPaid() ? true : false,
|
|
|
|
]
|
|
|
|
);
|
2020-02-17 10:37:44 +01:00
|
|
|
}
|
|
|
|
}
|