message
parent
9191645dfc
commit
0bec6fc41f
|
|
@ -11,12 +11,12 @@ class SendFeedbackMessage {
|
||||||
|
|
||||||
public function handle(object $event) {
|
public function handle(object $event) {
|
||||||
try {
|
try {
|
||||||
$array = [
|
// $array = [
|
||||||
'email' => $event->email,
|
// 'email' => $event->email,
|
||||||
'data' => $event->data,
|
// 'data' => $event->data,
|
||||||
];
|
// ];
|
||||||
//mail('sergey@bodin.ru', 'Error', print_r($array, 1));
|
// mail('sergey@bodin.ru', 'Error', print_r($array, 1));
|
||||||
Mail::to($event->email)->send(new FeedbackSender());
|
Mail::to($event->email)->send(new FeedbackSender($event->data));
|
||||||
} catch (\Exception $exception) {
|
} catch (\Exception $exception) {
|
||||||
mail('sergey@bodin.ru', 'Error', $exception->getTraceAsString());
|
mail('sergey@bodin.ru', 'Error', $exception->getTraceAsString());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,10 +11,10 @@ use Illuminate\Queue\SerializesModels;
|
||||||
class FeedbackSender extends Mailable implements ShouldQueue {
|
class FeedbackSender extends Mailable implements ShouldQueue {
|
||||||
use Queueable, SerializesModels;
|
use Queueable, SerializesModels;
|
||||||
|
|
||||||
//public array $data;
|
public array $data;
|
||||||
|
|
||||||
public function __construct() {
|
public function __construct(array $data) {
|
||||||
//$this->data = $data;
|
$this->data = $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function build() {
|
public function build() {
|
||||||
|
|
|
||||||
|
|
@ -1 +1,9 @@
|
||||||
123
|
@extends('mail.layouts.layout')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<p>Вам пришло сообщение с обратной связи.</p>
|
||||||
|
<p class="mb-10">Email отправителя: {{$data['feedback-email']}}</p>
|
||||||
|
<p class="mb-10">Имя отправителя: {{$data['feedback-name']}}</p>
|
||||||
|
<p class="mb-10">Тема сообщения: {{$data['feedback-type']}}</p>
|
||||||
|
<p class="mb-10">Сообщение: {{$data['feedback-message']}}</p>
|
||||||
|
@endsection
|
||||||
Loading…
Reference in New Issue