Pull in upstream changes to the mail variables

This commit is contained in:
Kevin MacMartin 2020-02-25 15:41:15 -05:00
parent 333827eaae
commit c2c66e460b
3 changed files with 8 additions and 8 deletions

View file

@ -36,8 +36,9 @@ MAIL_PORT=587
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=tls
MAIL_SENDFROM=null
MAIL_SENDTO=null
MAIL_FROM_ADDRESS=null
MAIL_FROM_NAME="${APP_NAME}"
MAIL_TO_ADDRESS=null
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=

View file

@ -29,11 +29,10 @@ class ApiController extends Controller {
$contact->message = $request['message'];
$contact->save();
// Send the email if the MAIL_SENDTO variable is set
if (env('MAIL_SENDTO') != null) {
// Send the email if the MAIL_TO_ADDRESS variable is set
if (env('MAIL_TO_ADDRESS') != null) {
Mail::send('email.contact', [ 'contact' => $contact ], function($mail) use ($contact) {
$mail->from(env('MAIL_SENDFROM'), env('APP_NAME'))
->to(env('MAIL_SENDTO'))
$mail->to(env('MAIL_TO_ADDRESS'))
->subject('Contact form submission');
});
}

View file

@ -56,8 +56,8 @@ return [
*/
'from' => [
'address' => env('MAIL_SENDFROM', null),
'name' => env('APP_NAME', null),
'address' => env('MAIL_FROM_ADDRESS', null),
'name' => env('MAIL_FROM_NAME', null),
],
/*