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); + }); + } + +}