Commit bc8c008d authored by Nicolas Widart's avatar Nicolas Widart Committed by GitHub

Merge pull request #312 from mikemand/feature/email-subjects-translatable

Allow user Welcome and Password Reset email subjects to be translated
parents 693ec5a2 76d1a433
...@@ -11,6 +11,9 @@ return [ ...@@ -11,6 +11,9 @@ return [
'user no longer exists' => 'The user no longer exists.', 'user no longer exists' => 'The user no longer exists.',
'invalid reset code' => 'Invalid or expired reset code.', 'invalid reset code' => 'Invalid or expired reset code.',
'password reset' => 'Password has been reset. You can now login with your new password.', 'password reset' => 'Password has been reset. You can now login with your new password.',
/* Email subjects */
'welcome' => 'Welcome.',
'reset password' => 'Reset your account password.',
/* User management */ /* User management */
'user created' => 'User successfully created.', 'user created' => 'User successfully created.',
'user not found' => 'User not found.', 'user not found' => 'User not found.',
......
...@@ -16,11 +16,11 @@ class ResetPasswordEmail extends Mailable implements ShouldQueue ...@@ -16,11 +16,11 @@ class ResetPasswordEmail extends Mailable implements ShouldQueue
* @var UserInterface * @var UserInterface
*/ */
public $user; public $user;
/** /**
* @var * @var
*/ */
public $code; public $code;
protected $subject = 'Reset your account password.';
public function __construct(UserInterface $user, $code) public function __construct(UserInterface $user, $code)
{ {
...@@ -35,6 +35,7 @@ class ResetPasswordEmail extends Mailable implements ShouldQueue ...@@ -35,6 +35,7 @@ class ResetPasswordEmail extends Mailable implements ShouldQueue
*/ */
public function build() public function build()
{ {
return $this->view('user::emails.reminder'); return $this->view('user::emails.reminder')
->subject(trans('user::messages.reset password'));
} }
} }
...@@ -16,13 +16,12 @@ class WelcomeEmail extends Mailable implements ShouldQueue ...@@ -16,13 +16,12 @@ class WelcomeEmail extends Mailable implements ShouldQueue
* @var UserInterface * @var UserInterface
*/ */
public $user; public $user;
/** /**
* @var * @var
*/ */
public $activationCode; public $activationCode;
protected $subject = 'Welcome.';
public function __construct(UserInterface $user, $activationCode) public function __construct(UserInterface $user, $activationCode)
{ {
$this->user = $user; $this->user = $user;
...@@ -36,6 +35,7 @@ class WelcomeEmail extends Mailable implements ShouldQueue ...@@ -36,6 +35,7 @@ class WelcomeEmail extends Mailable implements ShouldQueue
*/ */
public function build() public function build()
{ {
return $this->view('user::emails.welcome'); return $this->view('user::emails.welcome')
->subject(trans('user::messages.welcome'));
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment