70 lines
1.4 KiB
PHP
70 lines
1.4 KiB
PHP
<?php
|
||
|
||
namespace App\Mail;
|
||
|
||
use Illuminate\Bus\Queueable;
|
||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||
use Illuminate\Mail\Mailable;
|
||
use Illuminate\Mail\Mailables\Content;
|
||
use Illuminate\Mail\Mailables\Envelope;
|
||
use Illuminate\Queue\SerializesModels;
|
||
|
||
/**
|
||
* OTP メール送信クラス
|
||
*/
|
||
class EmailOtpMail extends Mailable
|
||
{
|
||
use Queueable, SerializesModels;
|
||
|
||
/**
|
||
* OTP コード(6桁)
|
||
*/
|
||
public string $otpCode;
|
||
|
||
/**
|
||
* オペレータ名
|
||
*/
|
||
public string $operatorName;
|
||
|
||
/**
|
||
* コンストラクタ
|
||
*/
|
||
public function __construct(string $otpCode, string $operatorName)
|
||
{
|
||
$this->otpCode = $otpCode;
|
||
$this->operatorName = $operatorName;
|
||
}
|
||
|
||
/**
|
||
* メールのエンベロープ
|
||
*/
|
||
public function envelope(): Envelope
|
||
{
|
||
return new Envelope(
|
||
subject: 'ログイン確認用OTPコード(有効期限:10分間)'
|
||
);
|
||
}
|
||
|
||
/**
|
||
* メールのコンテンツ
|
||
*/
|
||
public function content(): Content
|
||
{
|
||
return new Content(
|
||
view: 'emails.otp',
|
||
with: [
|
||
'otpCode' => $this->otpCode,
|
||
'operatorName' => $this->operatorName,
|
||
]
|
||
);
|
||
}
|
||
|
||
/**
|
||
* メールの添付ファイル
|
||
*/
|
||
public function attachments(): array
|
||
{
|
||
return [];
|
||
}
|
||
}
|