1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-06 11:12:43 +01:00
invoiceninja/app/Mail/MigrationCompleted.php

50 lines
1.1 KiB
PHP
Raw Normal View History

<?php
namespace App\Mail;
2021-01-31 06:07:45 +01:00
use App\Models\Company;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
class MigrationCompleted extends Mailable
{
// use Queueable, SerializesModels;
2021-01-31 06:07:45 +01:00
public $company;
public $check_data;
/**
* Create a new message instance.
*
* @return void
*/
2021-02-10 04:18:23 +01:00
public function __construct(Company $company, $check_data = '')
{
2021-01-31 06:07:45 +01:00
$this->company = $company;
$this->check_data = $check_data;
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
2021-01-31 06:07:45 +01:00
$data['settings'] = $this->company->settings;
$data['company'] = $this->company->fresh();
2021-02-02 06:11:33 +01:00
$data['whitelabel'] = $this->company->account->isPaid() ? true : false;
$data['check_data'] = $this->check_data;
2021-02-03 13:29:44 +01:00
$result = $this->from(config('mail.from.address'), config('mail.from.name'))
->view('email.import.completed', $data);
if($this->company->invoices->count() >=1)
$result->attach($this->company->invoices->first()->pdf_file_path());
return $result;
}
}