krgm.so-manager-dev.com/app/Mail/EmailOtpMail.php
OU.ZAIKOU 13d2ecfceb
All checks were successful
Deploy main / deploy (push) Successful in 25s
【ログイン】二重認証実装
2026-01-21 22:37:38 +09:00

70 lines
1.4 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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 [];
}
}