diff --git a/config/mail.php b/config/mail.php index bb92224c5..e458fefce 100755 --- a/config/mail.php +++ b/config/mail.php @@ -56,8 +56,8 @@ return [ */ 'from' => [ - 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), - 'name' => env('MAIL_FROM_NAME', 'Example'), + 'address' => env('SHOP_MAIL_FROM'), + 'name' => env('MAIL_FROM_NAME') ], /* diff --git a/packages/Webkul/Admin/src/Mail/NewInvoiceNotification.php b/packages/Webkul/Admin/src/Mail/NewInvoiceNotification.php index 4fbb84c71..f74f331b7 100755 --- a/packages/Webkul/Admin/src/Mail/NewInvoiceNotification.php +++ b/packages/Webkul/Admin/src/Mail/NewInvoiceNotification.php @@ -16,7 +16,7 @@ use Illuminate\Contracts\Queue\ShouldQueue; class NewInvoiceNotification extends Mailable { use Queueable, SerializesModels; - + /** * The invoice instance. * @@ -45,6 +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')) ->subject(trans('shop::app.mail.invoice.subject', ['order_id' => $order->id])) ->view('shop::emails.sales.new-invoice'); } diff --git a/packages/Webkul/Admin/src/Mail/NewOrderNotification.php b/packages/Webkul/Admin/src/Mail/NewOrderNotification.php index cc1f332af..c53782ac7 100755 --- a/packages/Webkul/Admin/src/Mail/NewOrderNotification.php +++ b/packages/Webkul/Admin/src/Mail/NewOrderNotification.php @@ -42,6 +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')) ->subject(trans('shop::app.mail.order.subject')) ->view('shop::emails.sales.new-order'); } diff --git a/packages/Webkul/Admin/src/Mail/NewShipmentNotification.php b/packages/Webkul/Admin/src/Mail/NewShipmentNotification.php index 259fc3daf..ae51be5d8 100755 --- a/packages/Webkul/Admin/src/Mail/NewShipmentNotification.php +++ b/packages/Webkul/Admin/src/Mail/NewShipmentNotification.php @@ -45,6 +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')) ->subject(trans('shop::app.mail.shipment.subject', ['order_id' => $order->id])) ->view('shop::emails.sales.new-shipment'); } diff --git a/packages/Webkul/Customer/src/Mail/VerificationEmail.php b/packages/Webkul/Customer/src/Mail/VerificationEmail.php index ef874a335..41fa0bc31 100755 --- a/packages/Webkul/Customer/src/Mail/VerificationEmail.php +++ b/packages/Webkul/Customer/src/Mail/VerificationEmail.php @@ -31,6 +31,7 @@ class VerificationEmail extends Mailable public function build() { return $this->to($this->verificationData['email']) + ->from(env('SHOP_MAIL_FROM')) ->subject('Verification email') ->view('shop::emails.customer.verification-email')->with('data', ['email' => $this->verificationData['email'], 'token' => $this->verificationData['token']]); } diff --git a/packages/Webkul/Customer/src/Notifications/CustomerResetPassword.php b/packages/Webkul/Customer/src/Notifications/CustomerResetPassword.php index 07a7e6d3a..1f8b39858 100755 --- a/packages/Webkul/Customer/src/Notifications/CustomerResetPassword.php +++ b/packages/Webkul/Customer/src/Notifications/CustomerResetPassword.php @@ -21,6 +21,7 @@ class CustomerResetPassword extends ResetPassword } return (new MailMessage) + ->from(env('SHOP_MAIL_FROM')) ->subject(__('shop::app.mail.forget-password.subject') ) ->view('shop::emails.customer.forget-password', [ 'user_name' => $notifiable->name, diff --git a/packages/Webkul/Shop/src/Mail/SubscriptionEmail.php b/packages/Webkul/Shop/src/Mail/SubscriptionEmail.php index 295b2883d..2acf41474 100755 --- a/packages/Webkul/Shop/src/Mail/SubscriptionEmail.php +++ b/packages/Webkul/Shop/src/Mail/SubscriptionEmail.php @@ -9,16 +9,20 @@ use Illuminate\Contracts\Queue\ShouldQueue; /** * Subscriber Mail class * - * @author Prashant Singh + * @author Prashant Singh @prashant-webkul + * * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) */ class SubscriptionEmail extends Mailable { use Queueable, SerializesModels; + public $subscriptionData; + public function __construct($subscriptionData) { $this->subscriptionData = $subscriptionData; } + /** * Build the message. * @@ -27,7 +31,8 @@ class SubscriptionEmail extends Mailable public function build() { return $this->to($this->subscriptionData['email']) - ->subject('subscription email') - ->view('shop::emails.customer.subscription-email')->with('data', ['content' => 'You Are Subscribed', 'token' => $this->subscriptionData['token']]); + ->from(env('SHOP_MAIL_FROM')) + ->subject('subscription email') + ->view('shop::emails.customer.subscription-email')->with('data', ['content' => 'You Are Subscribed', 'token' => $this->subscriptionData['token']]); } } \ No newline at end of file