diff --git a/packages/Webkul/Admin/src/Listeners/PasswordChange.php b/packages/Webkul/Admin/src/Listeners/PasswordChange.php new file mode 100644 index 000000000..88fedf523 --- /dev/null +++ b/packages/Webkul/Admin/src/Listeners/PasswordChange.php @@ -0,0 +1,31 @@ +guard('customer')->user()->id; $this->validate(request(), [ @@ -104,6 +105,7 @@ class CustomerController extends Controller if (isset ($data['oldpassword'])) { if ($data['oldpassword'] != "" || $data['oldpassword'] != null) { if (Hash::check($data['oldpassword'], auth()->guard('customer')->user()->password)) { + $isPasswordChanged = true; $data['password'] = bcrypt($data['password']); } else { session()->flash('warning', trans('shop::app.customer.account.profile.unmatch')); @@ -119,6 +121,10 @@ class CustomerController extends Controller if ($customer = $this->customerRepository->update($data, $id)) { + if ($isPasswordChanged) { + Event::dispatch('user.admin.update-password', $customer); + } + Event::dispatch('customer.update.after', $customer); Session()->flash('success', trans('shop::app.customer.account.profile.edit-success')); diff --git a/packages/Webkul/Customer/src/Notifications/CustomerUpdatePassword.php b/packages/Webkul/Customer/src/Notifications/CustomerUpdatePassword.php new file mode 100644 index 000000000..c12f36e97 --- /dev/null +++ b/packages/Webkul/Customer/src/Notifications/CustomerUpdatePassword.php @@ -0,0 +1,43 @@ +customer = $customer; + } + + /** + * Build the message. + * + * @return $this + */ + public function build() + { + return $this->from(core()->getSenderEmailDetails()['email'], core()->getSenderEmailDetails()['name']) + ->to($this->customer->email, $this->customer->name) + ->subject(trans('shop::app.mail.update-password.subject')) + ->view('shop::emails.customer.update-password', ['user' => $this->customer]); + } +} \ No newline at end of file diff --git a/packages/Webkul/Shop/src/Resources/lang/ar/app.php b/packages/Webkul/Shop/src/Resources/lang/ar/app.php index f071086dd..014e9ce1d 100644 --- a/packages/Webkul/Shop/src/Resources/lang/ar/app.php +++ b/packages/Webkul/Shop/src/Resources/lang/ar/app.php @@ -644,6 +644,13 @@ return [ 'thanks' => 'شكرا!' ], + 'update-password' => [ + 'subject' => 'تم تحديث كلمة السر', + 'dear' => ':name عزيزي', + 'info' => 'أنت تتلقى هذا البريد الإلكتروني لأنك قمت بتحديث كلمة المرور الخاصة بك.', + 'thanks' => 'شكرا!' + ], + 'customer' => [ 'new' => [ 'dear' => ':customer_name العزيز', diff --git a/packages/Webkul/Shop/src/Resources/lang/de/app.php b/packages/Webkul/Shop/src/Resources/lang/de/app.php index 6dc820f2e..087086960 100755 --- a/packages/Webkul/Shop/src/Resources/lang/de/app.php +++ b/packages/Webkul/Shop/src/Resources/lang/de/app.php @@ -638,6 +638,13 @@ return [ 'thanks' => 'Vielen Dank!' ], + 'update-password' => [ + 'subject' => 'Passwort aktualisiert', + 'dear' => 'Sehr geehrte/r :name', + 'info' => 'Sie erhalten diese E-Mail, weil Sie Ihr Passwort aktualisiert haben.', + 'thanks' => 'Vielen Dank!' + ], + 'customer' => [ 'new' => [ 'dear' => 'Sehr geehrte/r :customer_name', diff --git a/packages/Webkul/Shop/src/Resources/lang/en/app.php b/packages/Webkul/Shop/src/Resources/lang/en/app.php index f8e2465ba..a36510572 100755 --- a/packages/Webkul/Shop/src/Resources/lang/en/app.php +++ b/packages/Webkul/Shop/src/Resources/lang/en/app.php @@ -644,6 +644,13 @@ return [ 'thanks' => 'Thanks!' ], + 'update-password' => [ + 'subject' => 'Password Updated', + 'dear' => 'Dear :name', + 'info' => 'You are receiving this email because you have updated your password.', + 'thanks' => 'Thanks!' + ], + 'customer' => [ 'new' => [ 'dear' => 'Dear :customer_name', diff --git a/packages/Webkul/Shop/src/Resources/lang/es/app.php b/packages/Webkul/Shop/src/Resources/lang/es/app.php index 3bf85a6f6..01f8e8856 100644 --- a/packages/Webkul/Shop/src/Resources/lang/es/app.php +++ b/packages/Webkul/Shop/src/Resources/lang/es/app.php @@ -591,6 +591,12 @@ return [ 'final-summary' => 'Si no has solicitado cambiar de contraseña, ninguna acción es requerida por tu parte.', 'thanks' => '¡Gracias!' ], + 'update-password' => [ + 'subject' => 'Contraseña actualiza', + 'dear' => 'Estimado/a :name', + 'info' => 'Está recibiendo este correo electrónico porque ha actualizado su contraseña.', + 'thanks' => '¡Gracias!' + ], 'customer' => [ 'new' => [ 'dear' => 'Estimado/a :customer_name', diff --git a/packages/Webkul/Shop/src/Resources/lang/fa/app.php b/packages/Webkul/Shop/src/Resources/lang/fa/app.php index 0cc50ba21..02c289228 100644 --- a/packages/Webkul/Shop/src/Resources/lang/fa/app.php +++ b/packages/Webkul/Shop/src/Resources/lang/fa/app.php @@ -643,6 +643,13 @@ return [ 'thanks' => 'با تشکر' ], + 'update-password' => [ + 'subject' => 'پسورد آپدیت شد', + 'dear' => ':name عزیز', + 'info' => 'شما این ایمیل را دریافت می کنید زیرا رمز خود را به روز کرده اید.', + 'thanks' => 'با تشکر' + ], + 'customer' => [ 'new' => [ 'dear' => ':customer_name عزیز', diff --git a/packages/Webkul/Shop/src/Resources/lang/it/app.php b/packages/Webkul/Shop/src/Resources/lang/it/app.php index 9c3cce39d..ef9bb77d1 100644 --- a/packages/Webkul/Shop/src/Resources/lang/it/app.php +++ b/packages/Webkul/Shop/src/Resources/lang/it/app.php @@ -643,6 +643,13 @@ return [ 'thanks' => 'Grazie!' ], + 'update-password' => [ + 'subject' => 'Password aggiornata', + 'dear' => 'Cara :name', + 'info' => 'Ricevi questa email perché hai aggiornato la password.', + 'thanks' => 'Grazie!' + ], + 'customer' => [ 'new' => [ 'dear' => 'Gentile :customer_name', diff --git a/packages/Webkul/Shop/src/Resources/lang/ja/app.php b/packages/Webkul/Shop/src/Resources/lang/ja/app.php index 00647dd1b..319779f83 100644 --- a/packages/Webkul/Shop/src/Resources/lang/ja/app.php +++ b/packages/Webkul/Shop/src/Resources/lang/ja/app.php @@ -583,6 +583,12 @@ return [ 'final-summary' => 'Si no has solicitado cambiar de contraseña, ninguna acción es requerida por tu parte.', 'thanks' => 'ありがとうございます。' ], + 'update-password' => [ + 'subject' => 'パスワードが更新されました', + 'dear' => '様 :name', + 'info' => 'パスワードを更新したため、このメールをお送りしています。', + 'thanks' => 'ありがとうございます。' + ], 'customer' => [ 'new' => [ 'dear' => '様 :customer_name', diff --git a/packages/Webkul/Shop/src/Resources/lang/nl/app.php b/packages/Webkul/Shop/src/Resources/lang/nl/app.php index be9659793..781c3d476 100644 --- a/packages/Webkul/Shop/src/Resources/lang/nl/app.php +++ b/packages/Webkul/Shop/src/Resources/lang/nl/app.php @@ -648,6 +648,13 @@ return [ 'thanks' => 'Bedankt!' ], + 'update-password' => [ + 'subject' => 'Wachtwoord bijgewerkt', + 'dear' => 'Lieve :name', + 'info' => 'Je ontvangt deze e-mail omdat je je wachtwoord hebt bijgewerkt.', + 'thanks' => 'Bedankt!' + ], + 'customer' => [ 'new' => [ 'dear' => 'Lieve :customer_name', diff --git a/packages/Webkul/Shop/src/Resources/lang/pl/app.php b/packages/Webkul/Shop/src/Resources/lang/pl/app.php index 520c6f0f2..c16c22ce8 100644 --- a/packages/Webkul/Shop/src/Resources/lang/pl/app.php +++ b/packages/Webkul/Shop/src/Resources/lang/pl/app.php @@ -642,6 +642,13 @@ return [ 'thanks' => 'Dzięki!' ], + 'update-password' => [ + 'subject' => 'Hasło zaktualizowane', + 'dear' => 'Drogi/a :name', + 'info' => 'Otrzymujesz tę wiadomość e-mail, ponieważ zaktualizowałeś swoje hasło.', + 'thanks' => 'Dzięki!' + ], + 'customer' => [ 'new' => [ 'dear' => 'Drogi/a :customer_name', diff --git a/packages/Webkul/Shop/src/Resources/lang/pt_BR/app.php b/packages/Webkul/Shop/src/Resources/lang/pt_BR/app.php index 471f4d143..266ec6e97 100755 --- a/packages/Webkul/Shop/src/Resources/lang/pt_BR/app.php +++ b/packages/Webkul/Shop/src/Resources/lang/pt_BR/app.php @@ -616,6 +616,13 @@ return [ 'thanks' => 'Obrigado!' ], + 'update-password' => [ + 'subject' => 'Senha atualizada', + 'dear' => 'Caro :name', + 'info' => 'Você está recebendo este e-mail porque atualizou sua senha.', + 'thanks' => 'Obrigado!' + ], + 'customer' => [ 'new' => [ 'dear' => 'Caro :customer_name', diff --git a/packages/Webkul/Shop/src/Resources/lang/tr/app.php b/packages/Webkul/Shop/src/Resources/lang/tr/app.php index b98d85461..a6926e4ad 100644 --- a/packages/Webkul/Shop/src/Resources/lang/tr/app.php +++ b/packages/Webkul/Shop/src/Resources/lang/tr/app.php @@ -639,6 +639,13 @@ return [ 'thanks' => 'Teşekkürler!' ], + 'update-password' => [ + 'subject' => 'Şifre güncellendi', + 'dear' => 'Sayın :name', + 'info' => 'Bu e-postayı, şifrenizi güncellediğiniz için alıyorsunuz.', + 'thanks' => 'Teşekkürler!' + ], + 'customer' => [ 'new' => [ 'dear' => 'Sayın :customer_name', diff --git a/packages/Webkul/Shop/src/Resources/views/emails/admin/update-password.blade.php b/packages/Webkul/Shop/src/Resources/views/emails/admin/update-password.blade.php new file mode 100755 index 000000000..f1759daed --- /dev/null +++ b/packages/Webkul/Shop/src/Resources/views/emails/admin/update-password.blade.php @@ -0,0 +1,25 @@ +@component('shop::emails.layouts.master') +
+ ++ {{ __('shop::app.mail.update-password.dear', ['name' => $user->name]) }}, +
+ ++ {{ __('shop::app.mail.update-password.info') }} +
+ ++ {{ __('shop::app.mail.update-password.thanks') }} +
++ {{ __('shop::app.mail.update-password.dear', ['name' => $user->name]) }}, +
+ ++ {{ __('shop::app.mail.update-password.info') }} +
+ ++ {{ __('shop::app.mail.update-password.thanks') }} +
+