From 7536e54f4a5ee8b0680c81d684ce8a98b9d44c71 Mon Sep 17 00:00:00 2001 From: Jaroslav Drzik Date: Thu, 25 Jan 2024 13:54:47 +0100 Subject: [PATCH] Add mail address for feedback mail --- app/Http/Controllers/FeedbackController.php | 8 ++++++-- app/Mail/SendFeedbackMail.php | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/FeedbackController.php b/app/Http/Controllers/FeedbackController.php index 4d95105..1536a81 100644 --- a/app/Http/Controllers/FeedbackController.php +++ b/app/Http/Controllers/FeedbackController.php @@ -16,8 +16,12 @@ class FeedbackController extends Controller $message = $request->input('message'); $data = ['name' => $name,'email'=> $email,'message'=> $message, 'subject' => $subject ]; - - Mail::to('jaro@ttx.sk')->send(new SendFeedbackMail($data)); + + Mail::send('mails.feedback', $data, function($message) { + $message->to('jaro@ttx.sk', 'Jaroslv Drzik') + ->to('marosholub@gmail.com','Maros Holub') + ->subject('IKEA Feedback Mail'); + }); return response()->json(['success' => 'Send email successfully.']); } diff --git a/app/Mail/SendFeedbackMail.php b/app/Mail/SendFeedbackMail.php index 0158ba2..cdd23bc 100644 --- a/app/Mail/SendFeedbackMail.php +++ b/app/Mail/SendFeedbackMail.php @@ -25,6 +25,7 @@ class SendFeedbackMail extends Mailable $this->data = $data; } + /** * Build the message. * @@ -32,6 +33,6 @@ class SendFeedbackMail extends Mailable */ public function build() { - return $this->subject('IKEA Feedback Mail')->view('mails.feedback')->with(['data' => $this->data]); + return $this->subject('IKEA Feedback Mail')->cc('')->view('mails.feedback')->with(['data' => $this->data]); } }