1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-22 01:11:34 +02:00
invoiceninja/app/Mail/Subscription/OtpCode.php
2023-01-29 09:21:40 +11:00

64 lines
1.6 KiB
PHP

<?php
/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/
namespace App\Mail\Subscription;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\App;
class OtpCode extends Mailable
{
// use Queueable, SerializesModels;
public $company;
public $contact;
public $code;
/**
* Create a new message instance.
*
* @return void
*/
public function __construct($company, $contact, $code)
{
$this->company = $company;
$this->contact = $contact;
$this->code = $code;
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
App::setLocale($this->company->locale());
return $this->from(config('mail.from.address'), config('mail.from.name'))
->subject(ctrans('texts.otp_code_subject'))
->text('email.admin.generic_text')
->view('email.admin.generic')
->with([
'settings' => $this->company->settings,
'logo' => $this->company->present()->logo(),
'title' => ctrans('texts.otp_code_subject'),
'content' => ctrans('texts.otp_code_body', ['code' => $this->code]),
'whitelabel' => $this->company->account->isPaid(),
]);
}
}