From b67881df33ef27f8a60cf515ff02726cc54ebb65 Mon Sep 17 00:00:00 2001 From: soufiane Date: Thu, 15 Jun 2023 15:09:47 +0200 Subject: [PATCH] wip #6033 @3:00 modifications du template mail (traductions, css, ...) --- app/Models/AuthClient.php | 7 +++++++ app/Models/ClientUser.php | 36 ++++++++++++++++++++++++++++++++++++ app/User.php | 9 ++++++++- resources/fr.json | 3 +++ resources/js/app.js | 2 +- resources/lang/en/auth.php | 1 - resources/lang/en/mail.php | 8 ++++++++ resources/lang/fr/auth.php | 1 - 8 files changed, 63 insertions(+), 4 deletions(-) create mode 100644 app/Models/ClientUser.php create mode 100644 resources/fr.json create mode 100644 resources/lang/en/mail.php diff --git a/app/Models/AuthClient.php b/app/Models/AuthClient.php index 08e7494..ea00189 100644 --- a/app/Models/AuthClient.php +++ b/app/Models/AuthClient.php @@ -1,11 +1,13 @@ notify((new ResetPasswordNotification($token))->locale('fr')); + } } diff --git a/app/Models/ClientUser.php b/app/Models/ClientUser.php new file mode 100644 index 0000000..1cef4c0 --- /dev/null +++ b/app/Models/ClientUser.php @@ -0,0 +1,36 @@ +notify((new ResetPasswordNotification($token))->locale('fr')); + } + + /** + * Get the e-mail address where password reset links are sent. + * + * @return string + */ + public function getEmailForPasswordReset() + { + return $this->email; + } +} diff --git a/app/User.php b/app/User.php index 9f56799..f631dea 100644 --- a/app/User.php +++ b/app/User.php @@ -2,11 +2,12 @@ namespace App; +use Backpack\Base\app\Notifications\ResetPasswordNotification as ResetPasswordNotification; use Illuminate\Notifications\Notifiable; -use Illuminate\Contracts\Auth\MustVerifyEmail; use Illuminate\Foundation\Auth\User as Authenticatable; use Backpack\CRUD\CrudTrait; use Spatie\Permission\Traits\HasRoles; +use Cubist\Backpack\Facades\App; class User extends Authenticatable { @@ -31,4 +32,10 @@ class User extends Authenticatable protected $hidden = [ 'password', 'remember_token', ]; + + public function sendPasswordResetNotification($token) + { + $this->notify((new ResetPasswordNotification($token))->locale(App::getLocale())); + } + } diff --git a/resources/fr.json b/resources/fr.json new file mode 100644 index 0000000..979adea --- /dev/null +++ b/resources/fr.json @@ -0,0 +1,3 @@ +{ + "name": "John Doe" +} diff --git a/resources/js/app.js b/resources/js/app.js index eaed7d9..a24da2c 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -123,7 +123,7 @@ const app = new Vue({ this.price = parseFloat(this.$refs.optprice ?.dataset.default).toFixed(2) this.statusText = this.$refs.statusConfig ?.dataset.incomplete this.discount = this.$refs.discount ?.dataset.value - this.validateAction = this.$refs.forgotpwd ?.dataset.status + this.validateAction = this.$refs.forgotpwd ?.dataset.status //specific code for the forgot password confirmation }, watch: { diff --git a/resources/lang/en/auth.php b/resources/lang/en/auth.php index e5506df..4e7409f 100644 --- a/resources/lang/en/auth.php +++ b/resources/lang/en/auth.php @@ -15,5 +15,4 @@ return [ 'failed' => 'These credentials do not match our records.', 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', - ]; diff --git a/resources/lang/en/mail.php b/resources/lang/en/mail.php new file mode 100644 index 0000000..a4e8d4d --- /dev/null +++ b/resources/lang/en/mail.php @@ -0,0 +1,8 @@ + 'Regards', + 'footer_part1' => 'If you’re having trouble clicking the', + 'footer_part2' => 'button, copy and paste the URL below', + 'footer_part3' => ' into your web browser:
', +]; diff --git a/resources/lang/fr/auth.php b/resources/lang/fr/auth.php index fa8f772..d2e3c2c 100644 --- a/resources/lang/fr/auth.php +++ b/resources/lang/fr/auth.php @@ -15,5 +15,4 @@ return [ 'failed' => 'Ces identifiants s', 'throttle' => 'Trop de tentatives. Veuillez patienter :seconds secondes.', - ]; -- 2.39.5