From dd5733999782a88395ebca6f3cbadb1e4872af85 Mon Sep 17 00:00:00 2001 From: Jhonn Rodriguez Date: Sun, 27 Oct 2019 17:00:23 -0400 Subject: [PATCH] Update PostsController.php Notification via Email --- app/controllers/PostsController.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/app/controllers/PostsController.php b/app/controllers/PostsController.php index 5b5fc03..9ff8467 100644 --- a/app/controllers/PostsController.php +++ b/app/controllers/PostsController.php @@ -138,4 +138,16 @@ public function upload() echo url('/uploads/'. $fileName); } -} \ No newline at end of file + + public function email() + { + $user = $this->user; + $message = 'article has been created successfully'; + + Mail::send('emails.template', $data, function ($message) use ($user){ + $message->subject('Notification - Medium Article created'); + $message->to($user->email); + }); + } + +}