From 57beeb2c861c97142fab1db84f2354ac6ff7f540 Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Wed, 26 Feb 2020 10:36:25 +0800 Subject: [PATCH] update config about mail --- .env.example | 32 +++++++------ config/mail.php | 58 +++++++++++++++++------- resources/misc/changelogs/en/5.0.0.md | 1 + resources/misc/changelogs/zh_CN/5.0.0.md | 1 + 4 files changed, 60 insertions(+), 32 deletions(-) diff --git a/.env.example b/.env.example index 8c5aabb3..ef690298 100644 --- a/.env.example +++ b/.env.example @@ -23,26 +23,28 @@ DB_PREFIX= # New sites are *highly* recommended to use BCRYPT. # PWD_METHOD=BCRYPT -SALT=2c5ca184f017a9a1ffbd198ef69b0c0e APP_KEY= -MAIL_DRIVER = smtp -MAIL_HOST = null -MAIL_PORT = 465 -MAIL_USERNAME = null -MAIL_PASSWORD = null -MAIL_ENCRYPTION = null +MAIL_DRIVER=smtp +MAIL_HOST= +MAIL_PORT=465 +MAIL_USERNAME= +MAIL_PASSWORD= +MAIL_ENCRYPTION= +MAIL_FROM_ADDRESS= +MAIL_FROM_NAME= -CACHE_DRIVER = file -SESSION_DRIVER = file -QUEUE_DRIVER = sync + +CACHE_DRIVER=file +SESSION_DRIVER=file +QUEUE_DRIVER=sync REDIS_CLIENT=predis -REDIS_HOST = 127.0.0.1 -REDIS_PASSWORD = null -REDIS_PORT = 6379 +REDIS_HOST=127.0.0.1 +REDIS_PASSWORD=null +REDIS_PORT=6379 -PLUGINS_DIR = null -PLUGINS_URL = null +PLUGINS_DIR=null +PLUGINS_URL=null TEXTURES_DIR = null diff --git a/config/mail.php b/config/mail.php index ca49d83f..3c65eb3f 100644 --- a/config/mail.php +++ b/config/mail.php @@ -11,12 +11,12 @@ return [ | sending of e-mail. You may specify which one you're using throughout | your application here. By default, Laravel is setup for SMTP mail. | - | Supported: "smtp", "mail", "sendmail", "mailgun", "mandrill", - | "ses", "sparkpost", "log" + | Supported: "smtp", "sendmail", "mailgun", "ses", + | "postmark", "log", "array" | */ - 'driver' => env('MAIL_DRIVER'), + 'driver' => env('MAIL_DRIVER', 'smtp'), /* |-------------------------------------------------------------------------- @@ -29,7 +29,7 @@ return [ | */ - 'host' => env('MAIL_HOST', ''), + 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), /* |-------------------------------------------------------------------------- @@ -55,7 +55,10 @@ return [ | */ - 'from' => ['address' => null, 'name' => null], + 'from' => [ + 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), + 'name' => env('MAIL_FROM_NAME', 'Example'), + ], /* |-------------------------------------------------------------------------- @@ -83,17 +86,6 @@ return [ 'username' => env('MAIL_USERNAME'), - /* - |-------------------------------------------------------------------------- - | SMTP Server Password - |-------------------------------------------------------------------------- - | - | Here you may set the password required by your SMTP server to send out - | messages from your application. This will be given to the server on - | connection so that the application will be able to send messages. - | - */ - 'password' => env('MAIL_PASSWORD'), /* @@ -107,6 +99,38 @@ return [ | */ - 'sendmail' => env('SENDMAIL_COMMAND', '/usr/sbin/sendmail -bs'), + 'sendmail' => '/usr/sbin/sendmail -bs', + + /* + |-------------------------------------------------------------------------- + | Markdown Mail Settings + |-------------------------------------------------------------------------- + | + | If you are using Markdown based email rendering, you may configure your + | theme and component paths here, allowing you to customize the design + | of the emails. Or, you may simply stick with the Laravel defaults! + | + */ + + 'markdown' => [ + 'theme' => 'default', + + 'paths' => [ + resource_path('views/vendor/mail'), + ], + ], + + /* + |-------------------------------------------------------------------------- + | Log Channel + |-------------------------------------------------------------------------- + | + | If you are using the "log" driver, you may specify the logging channel + | if you prefer to keep mail messages separate from other log entries + | for simpler reading. Otherwise, the default channel will be used. + | + */ + + 'log_channel' => env('MAIL_LOG_CHANNEL'), ]; diff --git a/resources/misc/changelogs/en/5.0.0.md b/resources/misc/changelogs/en/5.0.0.md index b44ac2c0..8a1ce86a 100644 --- a/resources/misc/changelogs/en/5.0.0.md +++ b/resources/misc/changelogs/en/5.0.0.md @@ -22,6 +22,7 @@ - Support customizing textures storage directory. - Support searching players at players page. - Added Blessing Skin Shell. +- Support specifying "from" email address and name when sending email. ## Tweaked diff --git a/resources/misc/changelogs/zh_CN/5.0.0.md b/resources/misc/changelogs/zh_CN/5.0.0.md index ad07dcb5..d0017af6 100644 --- a/resources/misc/changelogs/zh_CN/5.0.0.md +++ b/resources/misc/changelogs/zh_CN/5.0.0.md @@ -22,6 +22,7 @@ - 支持自定义材质存储目录 - 角色页面可进行搜索 - 新增 Blessing Skin Shell +- 支持单独指定邮件发件人的地址和名称 ## 调整