mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
#1392 [profile] Changing email and sending confirmation
This commit is contained in:
parent
4530329a00
commit
d93d2ddf34
@ -33,4 +33,8 @@ return [
|
||||
'email_phone_not_found' => 'The E-mail, Phone Number is not correct!',
|
||||
|
||||
'disable_account' => 'Do you want to close your account? This operation cannot be undone.',
|
||||
|
||||
// Mail
|
||||
'update_email_mail_subject' => 'Email Updated!',
|
||||
'update_email_mail_message' => 'Your Email Has Been Updated!',
|
||||
];
|
||||
|
||||
@ -79,7 +79,7 @@
|
||||
<label class="control-label font-weight-bold">
|
||||
{{ trans("visiosoft.module.profile::field.email.name") }}
|
||||
</label>
|
||||
<input value="{{ user.email }}" type="text" disabled class="form-control">
|
||||
{{ userForm.fields.email.input|raw }}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ userForm.actions|raw }}
|
||||
|
||||
@ -16,6 +16,9 @@ class UserFormBuilder extends FormBuilder
|
||||
'last_name' => [
|
||||
'required' => true,
|
||||
],
|
||||
'email' => [
|
||||
'required' => true,
|
||||
],
|
||||
];
|
||||
|
||||
protected $actions = [
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
use Anomaly\Streams\Platform\Message\MessageBag;
|
||||
use Anomaly\UsersModule\User\UserModel;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Visiosoft\NotificationsModule\Notify\Notification\UserUpdateEmailMail;
|
||||
|
||||
class UserFormHandler
|
||||
{
|
||||
@ -16,8 +17,14 @@ class UserFormHandler
|
||||
return;
|
||||
}
|
||||
|
||||
$userModel->find(Auth::id())
|
||||
->update($builder->getPostData());
|
||||
$data = $builder->getPostData();
|
||||
|
||||
$user = $userModel->find(\auth()->id());
|
||||
if ($user->email != $data['email']) {
|
||||
$user->notify(new UserUpdateEmailMail());
|
||||
}
|
||||
|
||||
$user->update($builder->getPostData());
|
||||
$messages->success(trans('visiosoft.module.profile::message.success_update'));
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user