2022-12-10 02:28:54 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Invoice Ninja (https://invoiceninja.com).
|
|
|
|
*
|
|
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
|
|
*
|
2023-01-28 23:21:40 +01:00
|
|
|
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
2022-12-10 02:28:54 +01:00
|
|
|
*
|
|
|
|
* @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(),
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
}
|