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
|
|
|
|
{
|
|
|
|
use Queueable, SerializesModels;
|
|
|
|
|
|
|
|
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'))
|
2020-12-03 21:41:36 +01:00
|
|
|
|
2020-12-02 04:08:35 +01:00
|
|
|
->subject(ctrans('texts.download_files'))
|
|
|
|
->markdown(
|
|
|
|
'email.admin.download_files',
|
|
|
|
[
|
|
|
|
'url' => $this->file_path,
|
|
|
|
'logo' => $this->company->present()->logo,
|
|
|
|
]
|
|
|
|
);
|
2020-02-17 10:37:44 +01:00
|
|
|
}
|
|
|
|
}
|