diff --git a/backend/app/Http/Controllers/Auth/RegisteredUserController.php b/backend/app/Http/Controllers/Auth/RegisteredUserController.php index 882d4f0..cc84828 100644 --- a/backend/app/Http/Controllers/Auth/RegisteredUserController.php +++ b/backend/app/Http/Controllers/Auth/RegisteredUserController.php @@ -3,6 +3,7 @@ namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; +use App\Mail\UserRegistrationCompleted; use App\Models\Company; use App\Models\StudentData; use App\Models\User; @@ -11,6 +12,7 @@ use Illuminate\Http\Request; use Illuminate\Http\Response; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Hash; +use Mail; class RegisteredUserController extends Controller { @@ -71,10 +73,9 @@ class RegisteredUserController extends Controller ]); } + Mail::to($user)->sendNow(new UserRegistrationCompleted($user->name, $password)); event(new Registered($user)); - Auth::login($user); - return response()->noContent(); } } diff --git a/backend/app/Mail/UserRegistrationCompleted.php b/backend/app/Mail/UserRegistrationCompleted.php new file mode 100644 index 0000000..f4c6a57 --- /dev/null +++ b/backend/app/Mail/UserRegistrationCompleted.php @@ -0,0 +1,61 @@ +name = $name; + $this->password = $password; + } + + /** + * Get the message envelope. + */ + public function envelope(): Envelope + { + return new Envelope( + subject: '[ISOP] Účet vytvorený', + ); + } + + /** + * Get the message content definition. + */ + public function content(): Content + { + return new Content( + view: 'mail.registration.completed', + with: [ + "name" => $this->name, + "password" => $this->password + ] + ); + } + + /** + * Get the attachments for the message. + * + * @return array + */ + public function attachments(): array + { + return []; + } +} diff --git a/backend/resources/views/mail/registration/completed.blade.php b/backend/resources/views/mail/registration/completed.blade.php new file mode 100644 index 0000000..a712bc7 --- /dev/null +++ b/backend/resources/views/mail/registration/completed.blade.php @@ -0,0 +1,16 @@ +@include("parts.header") +

Vážená/ý {{ $name }},

+

vaša registrácia do systému ISOP UKF prebehla úspešne!

+
+ +

Vaše heslo je: {{ $password }}

+ +
+ +

Ďakujeme za vašu registráciu.

+ +
+ +

s pozdravom

+

Systém ISOP UKF

+@include("parts.footer") \ No newline at end of file diff --git a/backend/resources/views/parts/footer.blade.php b/backend/resources/views/parts/footer.blade.php new file mode 100644 index 0000000..9870926 --- /dev/null +++ b/backend/resources/views/parts/footer.blade.php @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/backend/resources/views/parts/header.blade.php b/backend/resources/views/parts/header.blade.php new file mode 100644 index 0000000..683e733 --- /dev/null +++ b/backend/resources/views/parts/header.blade.php @@ -0,0 +1,9 @@ + + + + + + Title + + + \ No newline at end of file