From 9d6da3e37b293f9f276a59d862a8a0655111a177 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 29 Mar 2020 23:47:41 +1100 Subject: [PATCH] Fixes for notifications (#3561) --- app/Http/Controllers/EmailController.php | 7 ++++--- app/Notifications/SendGenericNotification.php | 8 ++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/app/Http/Controllers/EmailController.php b/app/Http/Controllers/EmailController.php index bb573a764fcd..b1dab809005b 100644 --- a/app/Http/Controllers/EmailController.php +++ b/app/Http/Controllers/EmailController.php @@ -114,9 +114,10 @@ class EmailController extends BaseController } }); - - $data = []; - return response()->json($data, 200); + $entity->service()->markSent()->save(); + + return $this->itemResponse($entity); + } } diff --git a/app/Notifications/SendGenericNotification.php b/app/Notifications/SendGenericNotification.php index 46c3b232d10d..9c72bc1e04f3 100644 --- a/app/Notifications/SendGenericNotification.php +++ b/app/Notifications/SendGenericNotification.php @@ -58,8 +58,8 @@ class SendGenericNotification extends Notification implements ShouldQueue * @return array */ public function via($notifiable) - {\Log::error("via"); - return ['slack','mail']; + { + return ['mail']; } /** @@ -70,7 +70,7 @@ class SendGenericNotification extends Notification implements ShouldQueue */ public function toMail($notifiable) { -\Log::error("to mail"); + $subject = $this->generateEmailEntityHtml($this->entity, $this->subject, $this->contact); $body = $this->generateEmailEntityHtml($this->entity, $this->body, $this->contact); @@ -114,7 +114,7 @@ class SendGenericNotification extends Notification implements ShouldQueue public function toSlack($notifiable) { -\Log::error("slack"); + return ''; // $logo = $this->company->present()->logo(); // $amount = Number::formatMoney($this->invoice->amount, $this->invoice->client);