From 727c4c8f9f39f6df655c708c9312026762a74a1b Mon Sep 17 00:00:00 2001 From: Tokumeikoi Date: Wed, 19 Aug 2020 15:41:31 +0800 Subject: [PATCH] opt: mail config --- app/Http/Controllers/Admin/ConfigController.php | 8 +++++++- app/Http/Requests/Admin/ConfigSave.php | 6 ++++++ config/mail.php | 14 +++++++------- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/app/Http/Controllers/Admin/ConfigController.php b/app/Http/Controllers/Admin/ConfigController.php index db5771bd..1606a3ba 100755 --- a/app/Http/Controllers/Admin/ConfigController.php +++ b/app/Http/Controllers/Admin/ConfigController.php @@ -116,7 +116,13 @@ class ConfigController extends Controller 'apple_id' => config('v2board.apple_id') ], 'email' => [ - 'email_template' => config('v2board.email_template', 'default') + 'email_template' => config('v2board.email_template', 'default'), + 'email_host' => config('v2board.email_host'), + 'email_port' => config('v2board.email_port'), + 'email_username' => config('v2board.email_username'), + 'email_password' => config('v2board.email_password'), + 'email_encryption' => config('v2board.email_encryption'), + 'email_from_address' => config('v2board.email_from_address') ], 'telegram' => [ 'telegram_bot_enable' => config('v2board.telegram_bot_enable', 0), diff --git a/app/Http/Requests/Admin/ConfigSave.php b/app/Http/Requests/Admin/ConfigSave.php index c95766e0..988542a6 100755 --- a/app/Http/Requests/Admin/ConfigSave.php +++ b/app/Http/Requests/Admin/ConfigSave.php @@ -85,6 +85,12 @@ class ConfigSave extends FormRequest 'apple_id_password' => '', // email 'email_template' => '', + 'email_host' => '', + 'email_port' => '', + 'email_username' => '', + 'email_password' => '', + 'email_encryption' => '', + 'email_from_address' => '', // telegram 'telegram_bot_enable' => 'in:0,1', 'telegram_bot_token' => '', diff --git a/config/mail.php b/config/mail.php index 7ad43e3e..f4c4cda9 100755 --- a/config/mail.php +++ b/config/mail.php @@ -29,7 +29,7 @@ return [ | */ - 'host' => env('MAIL_HOST', config('v2board.mail_host')), + 'host' => env('MAIL_HOST', config('v2board.email_host')), /* |-------------------------------------------------------------------------- @@ -42,7 +42,7 @@ return [ | */ - 'port' => env('MAIL_PORT', config('v2board.mail_port', 587)), + 'port' => env('MAIL_PORT', config('v2board.email_port', 587)), /* |-------------------------------------------------------------------------- @@ -56,8 +56,8 @@ return [ */ 'from' => [ - 'address' => env('MAIL_FROM_ADDRESS', config('v2board.mail_from_address')), - 'name' => env('MAIL_FROM_NAME', config('v2board.mail_from_address')), + 'address' => env('MAIL_FROM_ADDRESS', config('v2board.email_from_address')), + 'name' => env('MAIL_FROM_NAME', config('v2board.email_from_address')), ], /* @@ -71,7 +71,7 @@ return [ | */ - 'encryption' => env('MAIL_ENCRYPTION', config('v2board.mail_encryption')), + 'encryption' => env('MAIL_ENCRYPTION', config('v2board.email_encryption')), /* |-------------------------------------------------------------------------- @@ -84,9 +84,9 @@ return [ | */ - 'username' => env('MAIL_USERNAME', config('v2board.mail_username')), + 'username' => env('MAIL_USERNAME', config('v2board.email_username')), - 'password' => env('MAIL_PASSWORD', config('v2board.mail_password')), + 'password' => env('MAIL_PASSWORD', config('v2board.email_password')), /* |--------------------------------------------------------------------------