From a2e29ae0e6f8ceae06d9ef929153a013ba45edfe Mon Sep 17 00:00:00 2001 From: "sosuke.iwabuchi" Date: Thu, 25 Jan 2024 13:45:57 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E7=94=A8=E3=81=AB?= =?UTF-8?q?=E3=83=A1=E3=83=BC=E3=83=AB=E9=80=81=E4=BF=A1=E5=85=88=E3=82=92?= =?UTF-8?q?=E6=9B=B8=E3=81=8D=E6=8F=9B=E3=81=88=E5=87=A6=E7=90=86=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Logic/EmailManager.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/Logic/EmailManager.php b/app/Logic/EmailManager.php index 9898bb4..a5af2f1 100644 --- a/app/Logic/EmailManager.php +++ b/app/Logic/EmailManager.php @@ -125,9 +125,15 @@ class EmailManager if (app()->environment([EnvironmentName::STAGING->value])) { $email = $this->model->email; if (!Str::endsWith($email, ['@satellite-tech.co.jp', '@sute.jp', '@kyoto-public.or.jp'])) { - // 送信NG - info(sprintf("ローカル環境Email送信対象外アドレスのため、メール送信スキップ [%s]", $email)); - return; + $emailRewrite = config('mail.developmentEmail'); + if ($emailRewrite) { + // 送信先書き換え + $this->model->email = $emailRewrite; + } else { + // 送信NG + info(sprintf("ステージング環境Email送信対象外アドレスのため、メール送信スキップ [%s]", $email)); + return; + } } }