diff --git a/app/Http/Controllers/EmployerController.php b/app/Http/Controllers/EmployerController.php index 9479f9a..8837dbd 100644 --- a/app/Http/Controllers/EmployerController.php +++ b/app/Http/Controllers/EmployerController.php @@ -10,6 +10,8 @@ use App\Http\Requests\FlotRequest; use App\Http\Requests\MessagesRequiest; use App\Http\Requests\VacancyRequestEdit; use App\Http\Requests\VacansiaRequiest; +use App\Mail\MailAdminy; +use App\Mail\MailCreateEmployer; use App\Mail\MailSotrudnichestvo; use App\Mail\SendAllMessages; use App\Models\Ad_employer; @@ -475,6 +477,9 @@ class EmployerController extends Controller } else { $user = $this->create($params); event(new Registered($user)); + + Mail::to(env('EMAIL_ADMIN'))->send(new MailCreateEmployer($params)); + Auth::guard()->login($user); } diff --git a/app/Mail/MailCreateEmployer.php b/app/Mail/MailCreateEmployer.php new file mode 100644 index 0000000..68952a7 --- /dev/null +++ b/app/Mail/MailCreateEmployer.php @@ -0,0 +1,66 @@ +data = $data; + } + + /** + * Get the message envelope. + * + * @return \Illuminate\Mail\Mailables\Envelope + */ + public function envelope() + { + return new Envelope( + subject: 'Mail Create Employer', + ); + } + + /** + * Get the message content definition. + * + * @return \Illuminate\Mail\Mailables\Content + */ + public function content() + { + return new Content( + view: 'emails.create_emp', + ); + } + + public function build() + { + // Вернуть все данные + return $this->view('emails.create_emp', ['data' => $this->data]); + } + + /** + * Get the attachments for the message. + * + * @return array + */ + public function attachments() + { + return []; + } +} diff --git a/resources/views/emails/create_emp.blade.php b/resources/views/emails/create_emp.blade.php new file mode 100644 index 0000000..842badf --- /dev/null +++ b/resources/views/emails/create_emp.blade.php @@ -0,0 +1,6 @@ +
+ Зарегистрирован новый работодатель: {{ $data['surname']." ".$data['name_man']." ".$data['surname2'] }}
+ Email: {{ $data['email'] }}
+ Название компании: {{ $data['name_company'] }}
+ Телефон: {{ $data['telephone'] }}
+