From 987f70a9826ec7ce850ec1bc01caf62f5fd3ea7e Mon Sep 17 00:00:00 2001 From: "sosuke.iwabuchi" Date: Mon, 25 Sep 2023 19:55:44 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=AD=E3=83=BC=E3=82=AB=E3=83=AB=E7=92=B0?= =?UTF-8?q?=E5=A2=83=E6=99=82=E3=80=80=E3=83=A1=E3=83=BC=E3=83=AB=E3=81=AE?= =?UTF-8?q?=E9=80=81=E4=BF=A1=E5=87=A6=E7=90=86=E3=81=AB=E3=82=A2=E3=83=89?= =?UTF-8?q?=E3=83=AC=E3=82=B9=E3=81=AB=E3=82=88=E3=82=8B=E3=83=95=E3=82=A3?= =?UTF-8?q?=E3=83=AB=E3=82=BF=E3=83=BC=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Logic/EmailManager.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/Logic/EmailManager.php b/app/Logic/EmailManager.php index 060c407..d77562d 100644 --- a/app/Logic/EmailManager.php +++ b/app/Logic/EmailManager.php @@ -2,6 +2,7 @@ namespace App\Logic; +use App\Codes\EnvironmentName; use App\Events\Email\ConfirmEvent; use App\Exceptions\AppCommonException; use App\Email\BaseEmailer; @@ -10,6 +11,7 @@ use App\Models\EmailAttachment; use Exception; use Illuminate\Database\Eloquent\Collection; use Illuminate\Support\Carbon; +use Illuminate\Support\Str; use Validator; class EmailManager @@ -103,6 +105,15 @@ class EmailManager public function confirm() { + if (app()->environment([EnvironmentName::LOCAL->value])) { + + $email = $this->model->email; + if (!Str::endsWith($email, ['@sute.jp', '@satellite-tech.co.jp'])) { + info(sprintf("ローカル環境Email送信対象外アドレスのため、メール送信スキップ [%s]", $email)); + return; + } + } + $validator = Validator::make(['email' => $this->model->email], [ 'email' => ['required', 'email:strict,dns'] ]);