1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-21 00:41:34 +02:00
invoiceninja/app/Mail/MigrationCompleted.php

42 lines
957 B
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;
/**
* Create a new message instance.
*
* @return void
*/
2021-01-31 06:07:45 +01:00
public function __construct(Company $company)
{
2021-01-31 06:07:45 +01:00
$this->company = $company;
}
/**
* 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;
2021-02-02 06:11:33 +01:00
$data['whitelabel'] = $this->company->account->isPaid() ? true : false;
2020-12-03 12:00:34 +01:00
return $this->from(config('mail.from.address'), config('mail.from.name'))
2021-01-31 06:07:45 +01:00
->view('email.import.completed', $data)
->attach($this->company->invoices->first()->pdf_file_path());
}
}