diff --git a/app/Notifications/Expense/Bill.php b/app/Notifications/Expense/Bill.php index e436f4f92..85fa96668 100644 --- a/app/Notifications/Expense/Bill.php +++ b/app/Notifications/Expense/Bill.php @@ -46,9 +46,14 @@ class Bill extends Notification */ public function toMail($notifiable) { - return (new MailMessage) + $message = (new MailMessage) ->line('You are receiving this email because you have an upcoming ' . money($this->bill->amount, $this->bill->currency_code, true) . ' bill to ' . $this->bill->vendor_name . ' vendor.') ->action('Add Payment', url('expenses/bills', $this->bill->id, true)); + + // Override per company as Laravel doesn't read config + $message->from(config('mail.from.address'), config('mail.from.name')); + + return $message; } /** diff --git a/app/Notifications/Income/Invoice.php b/app/Notifications/Income/Invoice.php index 7d960114d..91edc0141 100644 --- a/app/Notifications/Income/Invoice.php +++ b/app/Notifications/Income/Invoice.php @@ -50,6 +50,9 @@ class Invoice extends Notification ->line(trans('invoices.notification.message', ['amount' => money($this->invoice->amount, $this->invoice->currency_code, true), 'customer' => $this->invoice->customer_name])) ->action(trans('invoices.notification.button'), url('customers/invoices', $this->invoice->id, true)); + // Override per company as Laravel doesn't read config + $message->from(config('mail.from.address'), config('mail.from.name')); + // Attach the PDF file if available if (isset($this->invoice->pdf_path)) { $message->attach($this->invoice->pdf_path, [ diff --git a/app/Notifications/Item/Item.php b/app/Notifications/Item/Item.php index ce1971bd3..83e74c08d 100644 --- a/app/Notifications/Item/Item.php +++ b/app/Notifications/Item/Item.php @@ -43,9 +43,14 @@ class Item extends Notification */ public function toMail($notifiable) { - return (new MailMessage) + $message = (new MailMessage) ->line(trans('items.notification.message', ['name' => $this->item->name])) ->action(trans('items.notification.button'), url('items/items', $this->item->id, true)); + + // Override per company as Laravel doesn't read config + $message->from(config('mail.from.address'), config('mail.from.name')); + + return $message; } /**