Merge pull request #1701 from MattApril/env-fix
Replace env() function usage with config() function, when outside of config file context
This commit is contained in:
commit
c26bf6c820
|
|
@ -60,6 +60,20 @@ return [
|
|||
'name' => env('MAIL_FROM_NAME')
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Global "Admin" Address
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| General admin related admins, such as order notifications.
|
||||
|
|
||||
*/
|
||||
|
||||
'admin' => [
|
||||
'address' => env('ADMIN_MAIL_TO'),
|
||||
'name' => env('ADMIN_MAIL_NAME', 'Admin')
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| E-Mail Encryption Protocol
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ class NewAdminNotification extends Mailable
|
|||
*/
|
||||
public function build()
|
||||
{
|
||||
return $this->to(env('ADMIN_MAIL_TO'))
|
||||
return $this->to(config('mail.admin.address'))
|
||||
->subject(trans('shop::app.mail.order.subject'))
|
||||
->view('shop::emails.sales.new-admin-order');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ class NewInvoiceNotification extends Mailable
|
|||
$order = $this->invoice->order;
|
||||
|
||||
return $this->to($order->customer_email, $order->customer_full_name)
|
||||
->from(env('SHOP_MAIL_FROM'))
|
||||
->from(config('mail.from'))
|
||||
->subject(trans('shop::app.mail.invoice.subject', ['order_id' => $order->increment_id]))
|
||||
->view('shop::emails.sales.new-invoice');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ class NewOrderNotification extends Mailable
|
|||
public function build()
|
||||
{
|
||||
return $this->to($this->order->customer_email, $this->order->customer_full_name)
|
||||
->from(env('SHOP_MAIL_FROM'))
|
||||
->from(config('mail.from'))
|
||||
->subject(trans('shop::app.mail.order.subject'))
|
||||
->view('shop::emails.sales.new-order');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ class NewRefundNotification extends Mailable
|
|||
$order = $this->refund->order;
|
||||
|
||||
return $this->to($order->customer_email, $order->customer_full_name)
|
||||
->from(env('SHOP_MAIL_FROM'))
|
||||
->from(config('mail.from'))
|
||||
->subject(trans('shop::app.mail.refund.subject', ['order_id' => $order->increment_id]))
|
||||
->view('shop::emails.sales.new-refund');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ class NewShipmentNotification extends Mailable
|
|||
$order = $this->shipment->order;
|
||||
|
||||
return $this->to($order->customer_email, $order->customer_full_name)
|
||||
->from(env('SHOP_MAIL_FROM'))
|
||||
->from(config('mail.from'))
|
||||
->subject(trans('shop::app.mail.shipment.subject', ['order_id' => $order->increment_id]))
|
||||
->view('shop::emails.sales.new-shipment');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ class RegistrationEmail extends Mailable
|
|||
public function build()
|
||||
{
|
||||
return $this->to($this->data['email'])
|
||||
->from(env('SHOP_MAIL_FROM'))
|
||||
->from(config('mail.from'))
|
||||
->subject(trans('shop::app.mail.customer.registration.customer-registration'))
|
||||
->view('shop::emails.customer.registration')->with('data', $this->data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ class VerificationEmail extends Mailable
|
|||
public function build()
|
||||
{
|
||||
return $this->to($this->verificationData['email'])
|
||||
->from(env('SHOP_MAIL_FROM'))
|
||||
->from(config('mail.from'))
|
||||
->subject(trans('shop::app.mail.customer.verification.subject'))
|
||||
->view('shop::emails.customer.verification-email')->with('data', ['email' => $this->verificationData['email'], 'token' => $this->verificationData['token']]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ class CustomerResetPassword extends ResetPassword
|
|||
}
|
||||
|
||||
return (new MailMessage)
|
||||
->from(env('SHOP_MAIL_FROM'))
|
||||
->from(config('mail.from'))
|
||||
->subject(__('shop::app.mail.forget-password.subject') )
|
||||
->view('shop::emails.customer.forget-password', [
|
||||
'user_name' => $notifiable->name,
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ class SubscriptionEmail extends Mailable
|
|||
public function build()
|
||||
{
|
||||
return $this->to($this->subscriptionData['email'])
|
||||
->from(env('SHOP_MAIL_FROM'))
|
||||
->from(config('mail.from'))
|
||||
->subject(trans('shop::app.mail.customer.subscription.subject'))
|
||||
->view('shop::emails.customer.subscription-email')->with('data', ['content' => 'You Are Subscribed', 'token' => $this->subscriptionData['token']]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -189,7 +189,7 @@
|
|||
<p style="font-size: 16px;color: #5E5E5E;line-height: 24px;">
|
||||
{!!
|
||||
__('shop::app.mail.order.help', [
|
||||
'support_email' => '<a style="color:#0041FF" href="mailto:' . env('ADMIN_MAIL_TO') . '">' . env('ADMIN_MAIL_TO'). '</a>'
|
||||
'support_email' => '<a style="color:#0041FF" href="mailto:' . config('mail.admin.address') . '">' . config('mail.admin.address') . '</a>'
|
||||
])
|
||||
!!}
|
||||
</p>
|
||||
|
|
|
|||
Loading…
Reference in New Issue