Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Rewrote all email messages.
James Colef029f7607b00
diff --git a/app/Events/RequestedNewPassword.php b/app/Events/RequestedNewPassword.phpnew file mode 100644index 0000000000..89e6455202--- /dev/null+++ b/app/Events/RequestedNewPassword.php@@ -0,0 +1,45 @@+<?php+/**+ * RequestedNewPassword.php+ * Copyright (C) 2016 [email protected]+ *+ * This software may be modified and distributed under the terms of the+ * Creative Commons Attribution-ShareAlike 4.0 International License.+ *+ * See the LICENSE file for details.+ */++declare(strict_types = 1);++namespace FireflyIII\Events;++use FireflyIII\User;+use Illuminate\Queue\SerializesModels;++/**+ * Class RequestedNewPassword+ *+ * @package FireflyIII\Events+ */+class RequestedNewPassword extends Event+{+ use SerializesModels;++ public $ipAddress;+ public $token;+ public $user;++ /**+ * Create a new event instance. This event is triggered when a users tries to reset his or her password.+ *+ * @param User $user+ * @param string $token+ */+ public function __construct(User $user, string $token, string $ipAddress)+ {+ $this->user = $user;+ $this->token = $token;+ $this->ipAddress = $ipAddress;+ }++}\ No newline at end of filediff --git a/app/Handlers/Events/UserEventHandler.php b/app/Handlers/Events/UserEventHandler.phpindex 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 UserEventHandlerPreferences::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.phpindex 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.phpindex 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.phpindex 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 != '[email protected]') {$message->to($email, $email)->subject('Caught an error in Firely III.');diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.phpindex b256815c13..62f2636336 100755--- a/app/Providers/EventServiceProvider.php+++ b/app/Providers/EventServiceProvider.php@@ -36,22 +36,25 @@ class EventServiceProvider extends ServiceProviderprotected $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.phpindex 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 Authenticatablereturn $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.phpindex 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.twigindex 8c23391b25..187a7cf1f4 100644--- a/resources/views/emails/blocked-login-html.twig+++ b/resources/views/emails/blocked-login-html.twig@@ -1,24 +1,8 @@-<!DOCTYPE html>-<html xmlns="http://www.w3.org/1999/xhtml">-<head>- <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">--</head>-<body itemscope itemtype="http://schema.org/SoftwareApplication">--<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">- Hey there,-</p>+{% include 'emails.header-html' %}<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">Firefly III has just blocked a login from user #{{ user_id }} ({{ user_address }}).</p><p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">The blocked code was "{{ code }}".</p>--<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:11px;color:#aaa;">- The login attempt came from IP {{ ip }}.-</p>--</body>-</html>+{% include 'emails.footer-html' %}diff --git a/resources/views/emails/blocked-login.twig b/resources/views/emails/blocked-login-text.twigsimilarity index 63%rename from resources/views/emails/blocked-login.twigrename to resources/views/emails/blocked-login-text.twigindex 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.twigindex ac78890963..23f39d2ef7 100644--- a/resources/views/emails/blocked-registration-html.twig+++ b/resources/views/emails/blocked-registration-html.twig@@ -1,24 +1,8 @@-<!DOCTYPE html>-<html xmlns="http://www.w3.org/1999/xhtml">-<head>- <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">--</head>-<body itemscope itemtype="http://schema.org/SoftwareApplication">--<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">- Hey there,-</p>+{% include 'emails.header-html' %}<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">Firefly III has just blocked a registration for an email addres at domain {{ blocked_domain }}.</p><p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">The blocked email address was "{{ email_address }}".</p>--<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:11px;color:#aaa;">- The login attempt came from IP {{ ip }}.-</p>--</body>-</html>+{% include 'emails.footer-html' %}diff --git a/resources/views/emails/blocked-registration.twig b/resources/views/emails/blocked-registration-text.twigsimilarity index 68%rename from resources/views/emails/blocked-registration.twigrename to resources/views/emails/blocked-registration-text.twigindex 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.twigindex 147f6d455e..a42e243d11 100644--- a/resources/views/emails/confirm-account-html.twig+++ b/resources/views/emails/confirm-account-html.twig@@ -1,25 +1,14 @@-<!DOCTYPE html>-<html xmlns="http://www.w3.org/1999/xhtml">-<head>- <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">--</head>-<body>--<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">- Hey there!-</p>-+{% include 'emails.header-html' %}<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">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 isvalid. Unfortunately, not even the most complex routines can work this out, without actually sending an email message. And here it is!</p><p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">- To active your account, <a href="{{ route }}" style="color:#337ab7">click on this link</a>.+ To active your account please follow the link below.</p>-<p>- If the link does not work, you can browse there manually by copy/pasting it:+<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">+ <strong>PLEASE</strong> verify that this activation link goes to the Firefly III installation you expect it to be:</p><p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;"><a href="{{ route }}" style="color:#337ab7">{{ route }}</a>@@ -28,15 +17,4 @@<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">You should be redirected to the index page right away. The link expires in about four hours.</p>--<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">- Thank you, and enjoy!-</p>--<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">- James Cole-</p>--<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:11px;color:#aaa;">- You are getting this activation message because a new registration from IP {{ ip }} triggered it.-</p>+{% include 'emails.footer-html' %}\ No newline at end of filediff --git a/resources/views/emails/confirm-account.twig b/resources/views/emails/confirm-account-text.twigsimilarity index 62%rename from resources/views/emails/confirm-account.twigrename to resources/views/emails/confirm-account-text.twigindex 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 filediff --git a/resources/views/emails/error-html.blade.php b/resources/views/emails/error-html.blade.phpdeleted file mode 100644index b8f186249f..0000000000--- a/resources/views/emails/error-html.blade.php+++ /dev/null@@ -1,52 +0,0 @@-<!DOCTYPE html>-<html xmlns="http://www.w3.org/1999/xhtml">-<head>- <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">--</head>-<body>-<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">- Firefly III ran into an error: <span style="font-family: monospace;">{{ errorMessage }}</span>-</p>--<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">- The error was of type "{{ class }}".-</p>--<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">- The error occured on/at: {{ time }}.-</p>--<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">- This error occured in file <span style="font-family: monospace;">{{ file }}</span> on line {{ line }} with code {{ code }}.-</p>--<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">- {% if loggedIn %}- The error was encountered by user #{{ user.id }}, <a href="mailto:{{ user.email }}">{{ user.email }}</a>.- {% else %}- There was no user logged in for this error or no user was detected.- {% endif %}-</p>--<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">- The IP address related to this error is: {{ ip }}-</p>--<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">- The full stacktrace is below. If you think this is a bug in Firefly III, you- can forward this message to- <a href="mailto:[email protected]?subject=BUG!">[email protected]</a>.- This can help fix the bug you just encountered.-</p>-<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">- If you prefer, you can also open a new issue on <a href="https://github.com/JC5/firefly-iii/issues/new">Github</a>.-</p>--<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">- The full stacktrace is below:</p>-<p style="font-family: monospace;font-size:11px;color:#aaa">- {{ stacktrace|nl2br }}-</p>-</body>-</html>diff --git a/resources/views/emails/error-html.twig b/resources/views/emails/error-html.twigindex d486c0a1d5..e20947ee04 100644--- a/resources/views/emails/error-html.twig+++ b/resources/views/emails/error-html.twig@@ -1,10 +1,4 @@-<!DOCTYPE html>-<html xmlns="http://www.w3.org/1999/xhtml">-<head>- <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">--</head>-<body>+{% include 'emails.header-html' %}<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">Firefly III ran into an error: <span style="font-family: monospace;">{{ errorMessage }}</span></p>@@ -48,5 +42,4 @@<p style="font-family: monospace;font-size:11px;color:#aaa">{{ stacktrace|nl2br }}</p>-</body>-</html>+{% include 'emails.footer-html' %}\ No newline at end of filediff --git a/resources/views/emails/error.twig b/resources/views/emails/error-text.twigsimilarity index 91%rename from resources/views/emails/error.twigrename to resources/views/emails/error-text.twigindex 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/newThe full stacktrace is below:{{ stacktrace }}+{% include 'emails.footer-text' %}\ No newline at end of filediff --git a/resources/views/emails/footer-html.twig b/resources/views/emails/footer-html.twignew file mode 100644index 0000000000..c058fcc605--- /dev/null+++ b/resources/views/emails/footer-html.twig@@ -0,0 +1,13 @@+<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">+ Beep boop,+</p>+<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">+ The Firefly III Mail Robot+</p>++<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:11px;color:#aaa;">+ PS: This message was sent because a request from IP {{ ip }} triggered it.+</p>++</body>+</html>\ No newline at end of filediff --git a/resources/views/emails/footer-text.twig b/resources/views/emails/footer-text.twignew file mode 100644index 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.twignew file mode 100644index 0000000000..af1f37648b--- /dev/null+++ b/resources/views/emails/header-html.twig@@ -0,0 +1,10 @@+<!DOCTYPE html>+<html xmlns="http://www.w3.org/1999/xhtml">+<head>+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">++</head>+<body>+<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">+ Hi there,+</p>\ No newline at end of filediff --git a/resources/views/emails/header-text.twig b/resources/views/emails/header-text.twignew file mode 100644index 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.twignew file mode 100644index 0000000000..a285167b6b--- /dev/null+++ b/resources/views/emails/password-html.twig@@ -0,0 +1,13 @@+{% include 'emails.header-html' %}+<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">+ Somebody tried to reset your password. If it was you, please follow the link below to do so.+</p>++<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">+ <strong>PLEASE</strong> verify that the link actually goes to the Firefly III you expect it to go!+</p>++<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">+ <a href="{{ url }}">{{ url }}</a>+</p>+{% include 'emails.footer-html' %}\ No newline at end of filediff --git a/resources/views/emails/password-text.twig b/resources/views/emails/password-text.twignew file mode 100644index 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 filediff --git a/resources/views/emails/password.twig b/resources/views/emails/password.twigdeleted file mode 100644index 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.twigindex 02d2407d94..fcc1688488 100644--- a/resources/views/emails/registered-html.twig+++ b/resources/views/emails/registered-html.twig@@ -1,14 +1,4 @@-<!DOCTYPE html>-<html xmlns="http://www.w3.org/1999/xhtml">-<head>- <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">--</head>-<body>-<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">- Hey there,-</p>-+{% include 'emails.header-html' %}<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">Welkome to <a style="color:#337ab7" href="{{ address }}">Firefly III</a>. Your registration has made it, and this email is here to confirm it. Yay!</p>@@ -31,17 +21,4 @@link very soon!</li></ul>--<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">- Enjoy!-</p>-<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">- James Cole-</p>--<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:11px;color:#aaa;">- The registration has been created from IP {{ ip }}-</p>--</body>-</html>+{% include 'emails.footer-html' %}diff --git a/resources/views/emails/registered.twig b/resources/views/emails/registered-text.twigsimilarity index 89%rename from resources/views/emails/registered.twigrename to resources/views/emails/registered-text.twigindex 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-usehttp://jc5.github.io/firefly-iii//description/The registration has been created from IP {{ ip }}+{% include 'emails.footer-text' %}\ No newline at end of filediff --git a/routes/web.php b/routes/web.phpindex 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');