From f029f7607b00ea40c866750c165e6d258e86d1e3 Mon Sep 17 00:00:00 2001 From: James Cole Date: Tue, 22 Nov 2016 21:21:11 +0100 Subject: [PATCH] Rewrote all email messages. --- app/Events/RequestedNewPassword.php | 45 ++++++++++++ app/Handlers/Events/UserEventHandler.php | 32 ++++++++- app/Http/Controllers/Auth/LoginController.php | 2 +- .../Controllers/Auth/RegisterController.php | 2 +- app/Jobs/MailError.php | 2 +- app/Providers/EventServiceProvider.php | 11 +-- app/User.php | 51 ++++---------- config/auth.php | 70 +------------------ .../views/emails/blocked-login-html.twig | 20 +----- ...ked-login.twig => blocked-login-text.twig} | 6 +- .../emails/blocked-registration-html.twig | 20 +----- ...on.twig => blocked-registration-text.twig} | 6 +- .../views/emails/confirm-account-html.twig | 32 ++------- ...account.twig => confirm-account-text.twig} | 15 ++-- resources/views/emails/error-html.blade.php | 52 -------------- resources/views/emails/error-html.twig | 11 +-- .../emails/{error.twig => error-text.twig} | 2 + resources/views/emails/footer-html.twig | 13 ++++ resources/views/emails/footer-text.twig | 6 ++ resources/views/emails/header-html.twig | 10 +++ resources/views/emails/header-text.twig | 2 + resources/views/emails/password-html.twig | 13 ++++ resources/views/emails/password-text.twig | 7 ++ resources/views/emails/password.twig | 1 - resources/views/emails/registered-html.twig | 27 +------ .../{registered.twig => registered-text.twig} | 4 +- routes/web.php | 2 +- 27 files changed, 179 insertions(+), 285 deletions(-) create mode 100644 app/Events/RequestedNewPassword.php rename resources/views/emails/{blocked-login.twig => blocked-login-text.twig} (63%) rename resources/views/emails/{blocked-registration.twig => blocked-registration-text.twig} (68%) rename resources/views/emails/{confirm-account.twig => confirm-account-text.twig} (62%) delete mode 100644 resources/views/emails/error-html.blade.php rename resources/views/emails/{error.twig => error-text.twig} (91%) create mode 100644 resources/views/emails/footer-html.twig create mode 100644 resources/views/emails/footer-text.twig create mode 100644 resources/views/emails/header-html.twig create mode 100644 resources/views/emails/header-text.twig create mode 100644 resources/views/emails/password-html.twig create mode 100644 resources/views/emails/password-text.twig delete mode 100644 resources/views/emails/password.twig rename resources/views/emails/{registered.twig => registered-text.twig} (89%) diff --git a/app/Events/RequestedNewPassword.php b/app/Events/RequestedNewPassword.php new file mode 100644 index 0000000000..89e6455202 --- /dev/null +++ b/app/Events/RequestedNewPassword.php @@ -0,0 +1,45 @@ +user = $user; + $this->token = $token; + $this->ipAddress = $ipAddress; + } + +} \ No newline at end of file diff --git a/app/Handlers/Events/UserEventHandler.php b/app/Handlers/Events/UserEventHandler.php index bf10bb71ea..ef3b1d212f 100644 --- a/app/Handlers/Events/UserEventHandler.php +++ b/app/Handlers/Events/UserEventHandler.php @@ -17,6 +17,7 @@ use Exception; use FireflyConfig; use FireflyIII\Events\ConfirmedUser; use FireflyIII\Events\RegisteredUser; +use FireflyIII\Events\RequestedNewPassword; use FireflyIII\Events\ResentConfirmation; use FireflyIII\Repositories\User\UserRepositoryInterface; use FireflyIII\User; @@ -101,6 +102,33 @@ class UserEventHandler } + /** + * @param RequestedNewPassword $event + * + * @return bool + */ + public function sendNewPassword(RequestedNewPassword $event): bool + { + $email = $event->user->email; + $ipAddress = $event->ipAddress; + $token = $event->token; + + $url = route('password.reset', [$token]); + + // send email. + try { + Mail::send( + ['emails.password-html', 'emails.password-text'], ['url' => $url, 'ip' => $ipAddress], function (Message $message) use ($email) { + $message->to($email, $email)->subject('Your password reset request'); + } + ); + } catch (Swift_TransportException $e) { + Log::error($e->getMessage()); + } + + return true; + } + /** * This method will send the user a registration mail, welcoming him or her to Firefly III. * This message is only sent when the configuration of Firefly III says so. @@ -123,7 +151,7 @@ class UserEventHandler // send email. try { Mail::send( - ['emails.registered-html', 'emails.registered'], ['address' => $address, 'ip' => $ipAddress], function (Message $message) use ($email) { + ['emails.registered-html', 'emails.registered-text'], ['address' => $address, 'ip' => $ipAddress], function (Message $message) use ($email) { $message->to($email, $email)->subject('Welcome to Firefly III! '); } ); @@ -191,7 +219,7 @@ class UserEventHandler Preferences::setForUser($user, 'user_confirmed_code', $code); try { Mail::send( - ['emails.confirm-account-html', 'emails.confirm-account'], ['route' => $route, 'ip' => $ipAddress], + ['emails.confirm-account-html', 'emails.confirm-account-text'], ['route' => $route, 'ip' => $ipAddress], function (Message $message) use ($email) { $message->to($email, $email)->subject('Please confirm your Firefly III account'); } diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index e805c6fc6c..4d39b49247 100755 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -188,7 +188,7 @@ class LoginController extends Controller ]; Mail::send( - ['emails.blocked-login-html', 'emails.blocked-login'], $fields, function (Message $message) use ($email, $user) { + ['emails.blocked-login-html', 'emails.blocked-login-text'], $fields, function (Message $message) use ($email, $user) { $message->to($email, $email)->subject('Blocked a login attempt from ' . trim($user->email) . '.'); } ); diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index 8de1eb1d63..2a62f91ff8 100755 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -221,7 +221,7 @@ class RegisterController extends Controller ]; Mail::send( - ['emails.blocked-registration-html', 'emails.blocked-registration'], $fields, function (Message $message) use ($email, $domain) { + ['emails.blocked-registration-html', 'emails.blocked-registration-text'], $fields, function (Message $message) use ($email, $domain) { $message->to($email, $email)->subject('Blocked a registration attempt with domain ' . $domain . '.'); } ); diff --git a/app/Jobs/MailError.php b/app/Jobs/MailError.php index a0974e694b..883443f9a7 100644 --- a/app/Jobs/MailError.php +++ b/app/Jobs/MailError.php @@ -78,7 +78,7 @@ class MailError extends Job implements ShouldQueue $args['ip'] = $this->ipAddress; Mail::send( - ['emails.error-html', 'emails.error'], $args, + ['emails.error-html', 'emails.error-text'], $args, function (Message $message) use ($email) { if ($email != 'mail@example.com') { $message->to($email, $email)->subject('Caught an error in Firely III.'); diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index b256815c13..62f2636336 100755 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -36,22 +36,25 @@ class EventServiceProvider extends ServiceProvider protected $listen = [ // new event handlers: - 'FireflyIII\Events\ConfirmedUser' => // is a User related event. + 'FireflyIII\Events\ConfirmedUser' => // is a User related event. [ 'FireflyIII\Handlers\Events\UserEventHandler@storeConfirmationIpAddress', ], - 'FireflyIII\Events\RegisteredUser' => // is a User related event. + 'FireflyIII\Events\RegisteredUser' => // is a User related event. [ 'FireflyIII\Handlers\Events\UserEventHandler@sendRegistrationMail', 'FireflyIII\Handlers\Events\UserEventHandler@attachUserRole', 'FireflyIII\Handlers\Events\UserEventHandler@sendConfirmationMessage', 'FireflyIII\Handlers\Events\UserEventHandler@storeRegistrationIpAddress', ], - 'FireflyIII\Events\ResentConfirmation' => // is a User related event. + 'FireflyIII\Events\RequestedNewPassword' => [ // is a User related event. + 'FireflyIII\Handlers\Events\UserEventHandler@sendNewPassword', + ], + 'FireflyIII\Events\ResentConfirmation' => // is a User related event. [ 'FireflyIII\Handlers\Events\UserEventHandler@sendConfirmationMessageAgain', ], - 'FireflyIII\Events\StoredBudgetLimit' => // is a Budget related event. + 'FireflyIII\Events\StoredBudgetLimit' => // is a Budget related event. [ 'FireflyIII\Handlers\Events\BudgetEventHandler@storeRepetition', ], diff --git a/app/User.php b/app/User.php index 72ccc2f8b8..35d9914236 100755 --- a/app/User.php +++ b/app/User.php @@ -14,52 +14,18 @@ declare(strict_types = 1); namespace FireflyIII; +use FireflyIII\Events\RequestedNewPassword; use Illuminate\Database\Eloquent\Relations\BelongsToMany; use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\Relations\HasManyThrough; use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Notifications\Notifiable; +use Request; /** * Class User * * @package FireflyIII - * @property integer $id - * @property \Carbon\Carbon $created_at - * @property \Carbon\Carbon $updated_at - * @property string $email - * @property string $password - * @property string $remember_token - * @property string $reset - * @property boolean $blocked - * @property string $blocked_code - * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Account[] $accounts - * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Attachment[] $attachments - * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Bill[] $bills - * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Budget[] $budgets - * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Category[] $categories - * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\ExportJob[] $exportJobs - * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\ImportJob[] $importJobs - * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\PiggyBank[] $piggyBanks - * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Preference[] $preferences - * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Role[] $roles - * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\RuleGroup[] $ruleGroups - * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Rule[] $rules - * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Tag[] $tags - * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\TransactionJournal[] $transactionJournals - * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Transaction[] $transactions - * @property-read \Illuminate\Notifications\DatabaseNotificationCollection|\Illuminate\Notifications\DatabaseNotification[] $notifications - * @property-read \Illuminate\Notifications\DatabaseNotificationCollection|\Illuminate\Notifications\DatabaseNotification[] $unreadNotifications - * @method static \Illuminate\Database\Query\Builder|\FireflyIII\User whereId($value) - * @method static \Illuminate\Database\Query\Builder|\FireflyIII\User whereCreatedAt($value) - * @method static \Illuminate\Database\Query\Builder|\FireflyIII\User whereUpdatedAt($value) - * @method static \Illuminate\Database\Query\Builder|\FireflyIII\User whereEmail($value) - * @method static \Illuminate\Database\Query\Builder|\FireflyIII\User wherePassword($value) - * @method static \Illuminate\Database\Query\Builder|\FireflyIII\User whereRememberToken($value) - * @method static \Illuminate\Database\Query\Builder|\FireflyIII\User whereReset($value) - * @method static \Illuminate\Database\Query\Builder|\FireflyIII\User whereBlocked($value) - * @method static \Illuminate\Database\Query\Builder|\FireflyIII\User whereBlockedCode($value) - * @mixin \Eloquent */ class User extends Authenticatable { @@ -246,5 +212,18 @@ class User extends Authenticatable return $this->hasManyThrough('FireflyIII\Models\Transaction', 'FireflyIII\Models\TransactionJournal'); } + /** + * Send the password reset notification. + * + * @param string $token + * @return void + */ + public function sendPasswordResetNotification($token) + { + $ip = Request::ip(); + + event(new RequestedNewPassword($this, $token, $ip)); + } + } diff --git a/config/auth.php b/config/auth.php index b7e3177e63..55a6840414 100755 --- a/config/auth.php +++ b/config/auth.php @@ -10,40 +10,10 @@ */ return [ - - /* - |-------------------------------------------------------------------------- - | Authentication Defaults - |-------------------------------------------------------------------------- - | - | This option controls the default authentication "guard" and password - | reset options for your application. You may change these defaults - | as required, but they're a perfect start for most applications. - | - */ - 'defaults' => [ 'guard' => 'web', 'passwords' => 'users', ], - - /* - |-------------------------------------------------------------------------- - | Authentication Guards - |-------------------------------------------------------------------------- - | - | Next, you may define every authentication guard for your application. - | Of course, a great default configuration has been defined for you - | here which uses session storage and the Eloquent user provider. - | - | All authentication drivers have a user provider. This defines how the - | users are actually retrieved out of your database or other storage - | mechanisms used by this application to persist your user's data. - | - | Supported: "session", "token" - | - */ - 'guards' => [ 'web' => [ 'driver' => 'session', @@ -55,55 +25,17 @@ return [ 'provider' => 'users', ], ], - - /* - |-------------------------------------------------------------------------- - | User Providers - |-------------------------------------------------------------------------- - | - | All authentication drivers have a user provider. This defines how the - | users are actually retrieved out of your database or other storage - | mechanisms used by this application to persist your user's data. - | - | If you have multiple user tables or models you may configure multiple - | sources which represent each model / table. These sources may then - | be assigned to any extra authentication guards you have defined. - | - | Supported: "database", "eloquent" - | - */ - 'providers' => [ 'users' => [ 'driver' => 'eloquent', 'model' => FireflyIII\User::class, ], ], - - /* - |-------------------------------------------------------------------------- - | Resetting Passwords - |-------------------------------------------------------------------------- - | - | Here you may set the options for resetting passwords including the view - | that is your password reset e-mail. You may also set the name of the - | table that maintains all of the reset tokens for your application. - | - | You may specify multiple password reset configurations if you have more - | than one user table or model in the application and you want to have - | separate password reset settings based on the specific user types. - | - | The expire time is the number of minutes that the reset token should be - | considered valid. This security feature keeps tokens short-lived so - | they have less time to be guessed. You may change this as needed. - | - */ - 'passwords' => [ 'users' => [ 'provider' => 'users', 'table' => 'password_resets', - 'expire' => 60, + 'expire' => 120, ], ], diff --git a/resources/views/emails/blocked-login-html.twig b/resources/views/emails/blocked-login-html.twig index 8c23391b25..187a7cf1f4 100644 --- a/resources/views/emails/blocked-login-html.twig +++ b/resources/views/emails/blocked-login-html.twig @@ -1,24 +1,8 @@ - - - - - - - - -

- Hey there, -

+{% include 'emails.header-html' %}

Firefly III has just blocked a login from user #{{ user_id }} ({{ user_address }}).

The blocked code was "{{ code }}".

- -

- The login attempt came from IP {{ ip }}. -

- - - +{% include 'emails.footer-html' %} diff --git a/resources/views/emails/blocked-login.twig b/resources/views/emails/blocked-login-text.twig similarity index 63% rename from resources/views/emails/blocked-login.twig rename to resources/views/emails/blocked-login-text.twig index 16402bd9e8..bad07a0769 100644 --- a/resources/views/emails/blocked-login.twig +++ b/resources/views/emails/blocked-login-text.twig @@ -1,7 +1,5 @@ -Hey there, - +{% include 'emails.header-text' %} Firefly III has just blocked a login from user #{{ user_id }} ({{ user_address }}). The blocked code was "{{ code }}". - -The login attempt came from IP {{ ip }} +{% include 'emails.footer-text' %} diff --git a/resources/views/emails/blocked-registration-html.twig b/resources/views/emails/blocked-registration-html.twig index ac78890963..23f39d2ef7 100644 --- a/resources/views/emails/blocked-registration-html.twig +++ b/resources/views/emails/blocked-registration-html.twig @@ -1,24 +1,8 @@ - - - - - - - - -

- Hey there, -

+{% include 'emails.header-html' %}

Firefly III has just blocked a registration for an email addres at domain {{ blocked_domain }}.

The blocked email address was "{{ email_address }}".

- -

- The login attempt came from IP {{ ip }}. -

- - - +{% include 'emails.footer-html' %} diff --git a/resources/views/emails/blocked-registration.twig b/resources/views/emails/blocked-registration-text.twig similarity index 68% rename from resources/views/emails/blocked-registration.twig rename to resources/views/emails/blocked-registration-text.twig index 3d5a2cccde..c01bcebdee 100644 --- a/resources/views/emails/blocked-registration.twig +++ b/resources/views/emails/blocked-registration-text.twig @@ -1,7 +1,5 @@ -Hey there, - +{% include 'emails.header-text' %} Firefly III has just blocked a registration for an email addres at domain {{ blocked_domain }}. The blocked email address was "{{ email_address }}". - -The login attempt came from IP {{ ip }}. +{% include 'emails.footer-text' %} diff --git a/resources/views/emails/confirm-account-html.twig b/resources/views/emails/confirm-account-html.twig index 147f6d455e..a42e243d11 100644 --- a/resources/views/emails/confirm-account-html.twig +++ b/resources/views/emails/confirm-account-html.twig @@ -1,25 +1,14 @@ - - - - - - - - -

- Hey there! -

- +{% include 'emails.header-html' %}

To start using your brand new Firefly III account, you need to activate it. Activating your account allows the website to verify that this email address is valid. Unfortunately, not even the most complex routines can work this out, without actually sending an email message. And here it is!

- To active your account, click on this link. + To active your account please follow the link below.

-

- If the link does not work, you can browse there manually by copy/pasting it: +

+ PLEASE verify that this activation link goes to the Firefly III installation you expect it to be:

{{ route }} @@ -28,15 +17,4 @@

You should be redirected to the index page right away. The link expires in about four hours.

- -

- Thank you, and enjoy! -

- -

- James Cole -

- -

- You are getting this activation message because a new registration from IP {{ ip }} triggered it. -

+{% include 'emails.footer-html' %} \ No newline at end of file diff --git a/resources/views/emails/confirm-account.twig b/resources/views/emails/confirm-account-text.twig similarity index 62% rename from resources/views/emails/confirm-account.twig rename to resources/views/emails/confirm-account-text.twig index 3fa0b9be14..8b5dbc9a6d 100644 --- a/resources/views/emails/confirm-account.twig +++ b/resources/views/emails/confirm-account-text.twig @@ -1,16 +1,11 @@ -Hey there! - +{% include 'emails.header-text' %} To start using your brand new Firefly III account, you need to activate it. Activating your account allows the website to verify that this email address is valid. Unfortunately, not even the most complex routines can work this out, without actually sending an email message. And here it is! -To active your account, you can click on the following link, or copy/paste it in your web browser: +To active your account please follow the link below. + +PLEASE verify that this activation link goes to the Firefly III installation you expect it to be: {{ route }} You should be redirected to the index page right away. The link expires in about four hours. - -Thank you, and enjoy! - -James Cole - - -You are getting this activation message because a new registration from IP {{ ip }} triggered it. +{% include 'emails.footer-text' %} \ No newline at end of file diff --git a/resources/views/emails/error-html.blade.php b/resources/views/emails/error-html.blade.php deleted file mode 100644 index b8f186249f..0000000000 --- a/resources/views/emails/error-html.blade.php +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - -

- Firefly III ran into an error: {{ errorMessage }} -

- -

- The error was of type "{{ class }}". -

- -

- The error occured on/at: {{ time }}. -

- -

- This error occured in file {{ file }} on line {{ line }} with code {{ code }}. -

- -

- {% if loggedIn %} - The error was encountered by user #{{ user.id }}, {{ user.email }}. - {% else %} - There was no user logged in for this error or no user was detected. - {% endif %} -

- -

- The IP address related to this error is: {{ ip }} -

- -

- The full stacktrace is below. If you think this is a bug in Firefly III, you - can forward this message to - thegrumpydictator@gmail.com. - This can help fix the bug you just encountered. -

-

- If you prefer, you can also open a new issue on Github. -

- -

- The full stacktrace is below:

-

- {{ stacktrace|nl2br }} -

- - diff --git a/resources/views/emails/error-html.twig b/resources/views/emails/error-html.twig index d486c0a1d5..e20947ee04 100644 --- a/resources/views/emails/error-html.twig +++ b/resources/views/emails/error-html.twig @@ -1,10 +1,4 @@ - - - - - - - +{% include 'emails.header-html' %}

Firefly III ran into an error: {{ errorMessage }}

@@ -48,5 +42,4 @@

{{ stacktrace|nl2br }}

- - +{% include 'emails.footer-html' %} \ No newline at end of file diff --git a/resources/views/emails/error.twig b/resources/views/emails/error-text.twig similarity index 91% rename from resources/views/emails/error.twig rename to resources/views/emails/error-text.twig index b772919798..5293cc5566 100644 --- a/resources/views/emails/error.twig +++ b/resources/views/emails/error-text.twig @@ -1,3 +1,4 @@ +{% include 'emails.header-text' %} Firefly III ran into an error: {{ errorMessage }}. The error was of type "{{ class }}". @@ -25,3 +26,4 @@ https://github.com/JC5/firefly-iii/issues/new The full stacktrace is below: {{ stacktrace }} +{% include 'emails.footer-text' %} \ No newline at end of file diff --git a/resources/views/emails/footer-html.twig b/resources/views/emails/footer-html.twig new file mode 100644 index 0000000000..c058fcc605 --- /dev/null +++ b/resources/views/emails/footer-html.twig @@ -0,0 +1,13 @@ +

+ Beep boop, +

+

+ The Firefly III Mail Robot +

+ +

+ PS: This message was sent because a request from IP {{ ip }} triggered it. +

+ + + \ No newline at end of file diff --git a/resources/views/emails/footer-text.twig b/resources/views/emails/footer-text.twig new file mode 100644 index 0000000000..f3ed37bbbd --- /dev/null +++ b/resources/views/emails/footer-text.twig @@ -0,0 +1,6 @@ + +Beep boop, + +The Firefly III Mail Robot + +PS: This message was sent because a request from IP {{ ip }} triggered it. diff --git a/resources/views/emails/header-html.twig b/resources/views/emails/header-html.twig new file mode 100644 index 0000000000..af1f37648b --- /dev/null +++ b/resources/views/emails/header-html.twig @@ -0,0 +1,10 @@ + + + + + + + +

+ Hi there, +

\ No newline at end of file diff --git a/resources/views/emails/header-text.twig b/resources/views/emails/header-text.twig new file mode 100644 index 0000000000..e60df7e024 --- /dev/null +++ b/resources/views/emails/header-text.twig @@ -0,0 +1,2 @@ +Hi there, + diff --git a/resources/views/emails/password-html.twig b/resources/views/emails/password-html.twig new file mode 100644 index 0000000000..a285167b6b --- /dev/null +++ b/resources/views/emails/password-html.twig @@ -0,0 +1,13 @@ +{% include 'emails.header-html' %} +

+ Somebody tried to reset your password. If it was you, please follow the link below to do so. +

+ +

+ PLEASE verify that the link actually goes to the Firefly III you expect it to go! +

+ +

+ {{ url }} +

+{% include 'emails.footer-html' %} \ No newline at end of file diff --git a/resources/views/emails/password-text.twig b/resources/views/emails/password-text.twig new file mode 100644 index 0000000000..3e64fe199a --- /dev/null +++ b/resources/views/emails/password-text.twig @@ -0,0 +1,7 @@ +{% include 'emails.header-text' %} +Somebody tried to reset your password. If it was you, please follow the link below to do so. + +PLEASE verify that the link actually goes to the Firefly III you expect it to go! + +{{ url }} +{% include 'emails.footer-text' %} \ No newline at end of file diff --git a/resources/views/emails/password.twig b/resources/views/emails/password.twig deleted file mode 100644 index d2be49d030..0000000000 --- a/resources/views/emails/password.twig +++ /dev/null @@ -1 +0,0 @@ -Click here to reset your password: {{ url('password/reset/' ~ token) }} diff --git a/resources/views/emails/registered-html.twig b/resources/views/emails/registered-html.twig index 02d2407d94..fcc1688488 100644 --- a/resources/views/emails/registered-html.twig +++ b/resources/views/emails/registered-html.twig @@ -1,14 +1,4 @@ - - - - - - - -

- Hey there, -

- +{% include 'emails.header-html' %}

Welkome to Firefly III. Your registration has made it, and this email is here to confirm it. Yay!

@@ -31,17 +21,4 @@ link very soon! - -

- Enjoy! -

-

- James Cole -

- -

- The registration has been created from IP {{ ip }} -

- - - +{% include 'emails.footer-html' %} diff --git a/resources/views/emails/registered.twig b/resources/views/emails/registered-text.twig similarity index 89% rename from resources/views/emails/registered.twig rename to resources/views/emails/registered-text.twig index 66dfca0eb9..1fd9db6eb8 100644 --- a/resources/views/emails/registered.twig +++ b/resources/views/emails/registered-text.twig @@ -1,5 +1,4 @@ -Hey there, - +{% include 'emails.header-text' %} Welkome to Firefly III. Your registration has made it, and this email is here to confirm it. Yay! * If you have forgotten your password already, please reset it using the password reset tool. @@ -19,3 +18,4 @@ https://github.com/JC5/firefly-iii/wiki/First-use http://jc5.github.io/firefly-iii//description/ The registration has been created from IP {{ ip }} +{% include 'emails.footer-text' %} \ No newline at end of file diff --git a/routes/web.php b/routes/web.php index 4a54029b1d..d66442dbb9 100755 --- a/routes/web.php +++ b/routes/web.php @@ -25,7 +25,7 @@ Route::group( Route::post('/register', 'Auth\RegisterController@register'); // Password Reset Routes... - Route::get('password/reset/{token}', 'Auth\ResetPasswordController@showResetForm'); + Route::get('password/reset/{token}', ['uses' => 'Auth\ResetPasswordController@showResetForm', 'as' => 'password.reset']); Route::post('/password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail'); Route::post('/password/reset', 'Auth\ResetPasswordController@reset'); Route::get('password/reset', 'Auth\ForgotPasswordController@showLinkRequestForm');