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 App\Utils\Ninja;
|
|
|
|
use Illuminate\Bus\Queueable;
|
|
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
|
|
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
|
|
|
|
*/
|
|
|
|
public function build()
|
|
|
|
{
|
|
|
|
|
2020-02-24 11:15:30 +01:00
|
|
|
return $this->subject(ctrans('texts.download_files'))
|
|
|
|
->markdown('email.admin.download_files',
|
|
|
|
[
|
|
|
|
'url' => $this->file_path,
|
|
|
|
'logo' => $this->company->present()->logo,
|
|
|
|
]);
|
|
|
|
|
|
|
|
// return $this->from(config('mail.from.address')) //todo this needs to be fixed to handle the hosted version
|
|
|
|
// ->subject(ctrans('texts.download_documents',['size'=>'']))
|
|
|
|
// ->markdown('email.admin.download_files', [
|
|
|
|
// 'file_path' => $this->file_path
|
|
|
|
// ]);
|
2020-02-17 10:37:44 +01:00
|
|
|
}
|
|
|
|
}
|