diff --git a/app/Events/AdminRequestedTestMessage.php b/app/Events/AdminRequestedTestMessage.php index 78f90858c8..4494bcd098 100644 --- a/app/Events/AdminRequestedTestMessage.php +++ b/app/Events/AdminRequestedTestMessage.php @@ -37,21 +37,16 @@ class AdminRequestedTestMessage extends Event { use SerializesModels; - /** @var string The users IP address */ - public $ipAddress; - /** @var User The user */ - public $user; + public User $user; /** * Create a new event instance. * * @param User $user - * @param string $ipAddress */ - public function __construct(User $user, string $ipAddress) + public function __construct(User $user) { - Log::debug(sprintf('Triggered AdminRequestedTestMessage for user #%d (%s) and IP %s!', $user->id, $user->email, $ipAddress)); + Log::debug(sprintf('Triggered AdminRequestedTestMessage for user #%d (%s)', $user->id, $user->email)); $this->user = $user; - $this->ipAddress = $ipAddress; } } diff --git a/app/Events/RequestedReportOnJournals.php b/app/Events/RequestedReportOnJournals.php index fc91987d1c..abbaf01a6e 100644 --- a/app/Events/RequestedReportOnJournals.php +++ b/app/Events/RequestedReportOnJournals.php @@ -40,10 +40,8 @@ class RequestedReportOnJournals { use Dispatchable, InteractsWithSockets, SerializesModels; - /** @var Collection The transaction groups to report on. */ - public $groups; - /** @var int The ID of the user. */ - public $userId; + public Collection $groups; + public int $userId; /** * Create a new event instance. diff --git a/app/Events/UserChangedEmail.php b/app/Events/UserChangedEmail.php index 8f4f70090d..6b6f3f9859 100644 --- a/app/Events/UserChangedEmail.php +++ b/app/Events/UserChangedEmail.php @@ -36,14 +36,9 @@ class UserChangedEmail extends Event { use SerializesModels; - /** @var string The user's IP address */ - public $ipAddress; - /** @var string The user's new email address */ - public $newEmail; - /** @var string The user's old email address */ - public $oldEmail; - /** @var User The user itself */ - public $user; + public string $newEmail; + public string $oldEmail; + public User $user; /** * UserChangedEmail constructor. @@ -51,12 +46,10 @@ class UserChangedEmail extends Event * @param User $user * @param string $newEmail * @param string $oldEmail - * @param string $ipAddress */ - public function __construct(User $user, string $newEmail, string $oldEmail, string $ipAddress) + public function __construct(User $user, string $newEmail, string $oldEmail) { $this->user = $user; - $this->ipAddress = $ipAddress; $this->oldEmail = $oldEmail; $this->newEmail = $newEmail; } diff --git a/app/Handlers/Events/APIEventHandler.php b/app/Handlers/Events/APIEventHandler.php index e871fd26cb..b85f5491ef 100644 --- a/app/Handlers/Events/APIEventHandler.php +++ b/app/Handlers/Events/APIEventHandler.php @@ -59,18 +59,16 @@ class APIEventHandler $email = config('firefly.site_owner'); } - $ipAddress = Request::ip(); - // see if user has alternative email address: $pref = app('preferences')->getForUser($user, 'remote_guard_alt_email'); if (null !== $pref) { $email = (string)(is_array($pref->data) ? $email : $pref->data); } - Log::debug(sprintf('Now in APIEventHandler::accessTokenCreated. Email is %s, IP is %s', $email, $ipAddress)); + Log::debug(sprintf('Now in APIEventHandler::accessTokenCreated. Email is %s', $email)); try { Log::debug('Trying to send message...'); - Mail::to($email)->send(new AccessTokenCreatedMail($email, $ipAddress)); + Mail::to($email)->send(new AccessTokenCreatedMail); } catch (Exception $e) { // @phpstan-ignore-line Log::debug('Send message failed! :('); diff --git a/app/Handlers/Events/AdminEventHandler.php b/app/Handlers/Events/AdminEventHandler.php index 5ed7953a67..7636491e4e 100644 --- a/app/Handlers/Events/AdminEventHandler.php +++ b/app/Handlers/Events/AdminEventHandler.php @@ -52,7 +52,6 @@ class AdminEventHandler // is user even admin? if ($repository->hasRole($event->user, 'owner')) { $email = $event->user->email; - $ipAddress = $event->ipAddress; // if user is demo user, send to owner: if ($event->user->hasRole('demo')) { @@ -65,10 +64,10 @@ class AdminEventHandler $email = $pref->data; } - Log::debug(sprintf('Now in sendTestMessage event handler. Email is %s, IP is %s', $email, $ipAddress)); + Log::debug(sprintf('Now in sendTestMessage event handler. Email is %s', $email)); try { Log::debug('Trying to send message...'); - Mail::to($email)->send(new AdminTestMail($email, $ipAddress)); + Mail::to($email)->send(new AdminTestMail($email)); // Laravel cannot pretend this process failed during testing. } catch (Exception $e) { // @phpstan-ignore-line diff --git a/app/Handlers/Events/AutomationHandler.php b/app/Handlers/Events/AutomationHandler.php index e05d596997..b9cc1d4062 100644 --- a/app/Handlers/Events/AutomationHandler.php +++ b/app/Handlers/Events/AutomationHandler.php @@ -58,23 +58,9 @@ class AutomationHandler $repository = app(UserRepositoryInterface::class); $user = $repository->find($event->userId); if (null !== $user && 0 !== $event->groups->count()) { - - $email = $user->email; - - // see if user has alternative email address: - $pref = app('preferences')->getForUser($user, 'remote_guard_alt_email'); - if (null !== $pref) { - $email = $pref->data; - } - - // if user is demo user, send to owner: - if ($user->hasRole('demo')) { - $email = config('firefly.site_owner'); - } - try { Log::debug('Trying to mail...'); - Mail::to($user->email)->send(new ReportNewJournalsMail($email, '127.0.0.1', $event->groups)); + Mail::to($user->email)->send(new ReportNewJournalsMail($event->groups)); } catch (Exception $e) { // @phpstan-ignore-line Log::debug('Send message failed! :('); diff --git a/app/Handlers/Events/UserEventHandler.php b/app/Handlers/Events/UserEventHandler.php index 1089eae7c4..3b413f6f2b 100644 --- a/app/Handlers/Events/UserEventHandler.php +++ b/app/Handlers/Events/UserEventHandler.php @@ -229,11 +229,10 @@ class UserEventHandler $newEmail = $event->newEmail; $oldEmail = $event->oldEmail; $user = $event->user; - $ipAddress = $event->ipAddress; $token = app('preferences')->getForUser($user, 'email_change_confirm_token', 'invalid'); $uri = route('profile.confirm-email-change', [$token->data]); try { - Mail::to($newEmail)->send(new ConfirmEmailChangeMail($newEmail, $oldEmail, $uri, $ipAddress)); + Mail::to($newEmail)->send(new ConfirmEmailChangeMail($newEmail, $oldEmail, $uri)); } catch (Exception $e) { // @phpstan-ignore-line Log::error($e->getMessage()); @@ -255,12 +254,11 @@ class UserEventHandler $newEmail = $event->newEmail; $oldEmail = $event->oldEmail; $user = $event->user; - $ipAddress = $event->ipAddress; $token = app('preferences')->getForUser($user, 'email_change_undo_token', 'invalid'); $hashed = hash('sha256', sprintf('%s%s', (string)config('app.key'), $oldEmail)); $uri = route('profile.undo-email-change', [$token->data, $hashed]); try { - Mail::to($oldEmail)->send(new UndoEmailChangeMail($newEmail, $oldEmail, $uri, $ipAddress)); + Mail::to($oldEmail)->send(new UndoEmailChangeMail($newEmail, $oldEmail, $uri)); } catch (Exception $e) { // @phpstan-ignore-line Log::error($e->getMessage()); diff --git a/app/Http/Controllers/Admin/HomeController.php b/app/Http/Controllers/Admin/HomeController.php index 3b4f76a38b..8c414119e9 100644 --- a/app/Http/Controllers/Admin/HomeController.php +++ b/app/Http/Controllers/Admin/HomeController.php @@ -83,9 +83,8 @@ class HomeController extends Controller Log::channel('audit')->info('User sends test message.'); /** @var User $user */ $user = auth()->user(); - $ipAddress = $request->ip(); - Log::debug(sprintf('Now in testMessage() controller. IP is %s', $ipAddress)); - event(new AdminRequestedTestMessage($user, $ipAddress)); + Log::debug('Now in testMessage() controller.'); + event(new AdminRequestedTestMessage($user)); session()->flash('info', (string)trans('firefly.send_test_triggered')); return redirect(route('admin.index')); diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index 138482886e..c61888412f 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -96,7 +96,7 @@ class RegisterController extends Controller $this->validator($request->all())->validate(); $user = $this->createUser($request->all()); Log::info(sprintf('Registered new user %s', $user->email)); - event(new RegisteredUser($user, $request->ip())); + event(new RegisteredUser($user)); $this->guard()->login($user); diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 8ffc94b11c..46a9049ced 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -27,6 +27,7 @@ use Exception; use FireflyIII\Events\RequestedVersionCheckStatus; use FireflyIII\Helpers\Collector\GroupCollectorInterface; use FireflyIII\Http\Middleware\Installer; +use FireflyIII\Mail\UndoEmailChangeMail; use FireflyIII\Models\AccountType; use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Repositories\Bill\BillRepositoryInterface; @@ -35,6 +36,7 @@ use Illuminate\Http\JsonResponse; use Illuminate\Http\Request; use Illuminate\Support\Collection; use Log; +use Mail; /** * Class HomeController. @@ -72,7 +74,7 @@ class HomeController extends Controller Log::debug('Received dateRange', ['start' => $request->get('start'), 'end' => $request->get('end'), 'label' => $request->get('label')]); // check if the label is "everything" or "Custom range" which will betray // a possible problem with the budgets. - if ($label === (string)trans('firefly.everything') || $label === (string)trans('firefly.customRange')) { + if ($label === (string) trans('firefly.everything') || $label === (string) trans('firefly.customRange')) { $isCustomRange = true; Log::debug('Range is now marked as "custom".'); } @@ -80,7 +82,7 @@ class HomeController extends Controller $diff = $start->diffInDays($end) + 1; if ($diff > 50) { - $request->session()->flash('warning', (string)trans('firefly.warning_much_data', ['days' => $diff])); + $request->session()->flash('warning', (string) trans('firefly.warning_much_data', ['days' => $diff])); } $request->session()->put('is_custom_range', $isCustomRange); @@ -112,7 +114,7 @@ class HomeController extends Controller if (0 === $count) { return redirect(route('new-user.index')); } - $subTitle = (string)trans('firefly.welcome_back'); + $subTitle = (string) trans('firefly.welcome_back'); $transactions = []; $frontPage = app('preferences')->getFresh('frontPageAccounts', $repository->getAccountsByType([AccountType::ASSET])->pluck('id')->toArray()); /** @var Carbon $start */ diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php index c2d2a47bda..239ebd607c 100644 --- a/app/Http/Controllers/ProfileController.php +++ b/app/Http/Controllers/ProfileController.php @@ -427,9 +427,7 @@ class ProfileController extends Controller // now actually update user: $repository->changeEmail($user, $newEmail); - // call event. - $ipAddress = $request->ip(); - event(new UserChangedEmail($user, $newEmail, $oldEmail, $ipAddress)); + event(new UserChangedEmail($user, $newEmail, $oldEmail)); // force user logout. Auth::guard()->logout(); diff --git a/app/Mail/AccessTokenCreatedMail.php b/app/Mail/AccessTokenCreatedMail.php index 88fccc3b4b..e37762201a 100644 --- a/app/Mail/AccessTokenCreatedMail.php +++ b/app/Mail/AccessTokenCreatedMail.php @@ -37,21 +37,11 @@ class AccessTokenCreatedMail extends Mailable use Queueable, SerializesModels; - /** @var string Email address of admin */ - public $email; - /** @var string IP address of admin */ - public $ipAddress; - /** * AccessTokenCreatedMail constructor. - * - * @param string $email - * @param string $ipAddress */ - public function __construct(string $email, string $ipAddress) + public function __construct() { - $this->email = $email; - $this->ipAddress = $ipAddress; } /** @@ -61,7 +51,8 @@ class AccessTokenCreatedMail extends Mailable */ public function build(): self { - return $this->view('emails.access-token-created-html')->text('emails.access-token-created-text') - ->subject((string)trans('email.access_token_created_subject')); + return $this + ->markdown('emails.token-created') + ->subject((string)trans('email.access_token_created_subject')); } } diff --git a/app/Mail/AdminTestMail.php b/app/Mail/AdminTestMail.php index 007ae979e8..ab173a0657 100644 --- a/app/Mail/AdminTestMail.php +++ b/app/Mail/AdminTestMail.php @@ -38,18 +38,15 @@ class AdminTestMail extends Mailable use Queueable, SerializesModels; public string $email; - public string $ipAddress; /** * ConfirmEmailChangeMail constructor. * * @param string $email - * @param string $ipAddress */ - public function __construct(string $email, string $ipAddress) + public function __construct(string $email) { $this->email = $email; - $this->ipAddress = $ipAddress; } /** @@ -59,7 +56,8 @@ class AdminTestMail extends Mailable */ public function build(): self { - return $this->view('emails.admin-test-html')->text('emails.admin-test-text') - ->subject((string)trans('email.admin_test_subject')); + return $this + ->markdown('emails.admin-test') + ->subject((string)trans('email.admin_test_subject')); } } diff --git a/app/Mail/BillWarningMail.php b/app/Mail/BillWarningMail.php index 9568411b43..3218dba926 100644 --- a/app/Mail/BillWarningMail.php +++ b/app/Mail/BillWarningMail.php @@ -14,7 +14,6 @@ class BillWarningMail extends Mailable public Bill $bill; public string $field; public int $diff; - public string $ipAddress; /** * ConfirmEmailChangeMail constructor. @@ -22,14 +21,12 @@ class BillWarningMail extends Mailable * @param Bill $bill * @param string $field * @param int $diff - * @param string $ipAddress */ - public function __construct(Bill $bill, string $field, int $diff, string $ipAddress) + public function __construct(Bill $bill, string $field, int $diff) { $this->bill = $bill; $this->field = $field; $this->diff = $diff; - $this->ipAddress = $ipAddress; } /** @@ -45,8 +42,7 @@ class BillWarningMail extends Mailable } return $this - ->view('emails.bill-warning-html') - ->text('emails.bill-warning-text') + ->markdown('emails.bill-warning') ->subject($subject); } } diff --git a/app/Mail/ConfirmEmailChangeMail.php b/app/Mail/ConfirmEmailChangeMail.php index 946e5068d3..d0aa293fc1 100644 --- a/app/Mail/ConfirmEmailChangeMail.php +++ b/app/Mail/ConfirmEmailChangeMail.php @@ -37,25 +37,23 @@ class ConfirmEmailChangeMail extends Mailable { use Queueable, SerializesModels; - public string $ipAddress; public string $newEmail; public string $oldEmail; - public string $uri; + public string $url; /** * ConfirmEmailChangeMail constructor. * * @param string $newEmail * @param string $oldEmail - * @param string $uri + * @param string $url * @param string $ipAddress */ - public function __construct(string $newEmail, string $oldEmail, string $uri, string $ipAddress) + public function __construct(string $newEmail, string $oldEmail, string $url) { $this->newEmail = $newEmail; $this->oldEmail = $oldEmail; - $this->uri = $uri; - $this->ipAddress = $ipAddress; + $this->url = $url; } /** @@ -65,7 +63,10 @@ class ConfirmEmailChangeMail extends Mailable */ public function build(): self { - return $this->view('emails.confirm-email-change-html')->text('emails.confirm-email-change-text') - ->subject((string) trans('email.email_change_subject')); + return $this + //->view('emails.confirm-email-change-html') + //->text('emails.confirm-email-change-text') + ->markdown('emails.confirm-email-change') + ->subject((string) trans('email.email_change_subject')); } } diff --git a/app/Mail/NewIPAddressWarningMail.php b/app/Mail/NewIPAddressWarningMail.php index 034873fae5..f056561051 100644 --- a/app/Mail/NewIPAddressWarningMail.php +++ b/app/Mail/NewIPAddressWarningMail.php @@ -56,8 +56,6 @@ class NewIPAddressWarningMail extends Mailable */ public function build(): self { - // time - $this->time = now(config('app.timezone'))->isoFormat((string)trans('config.date_time_js')); $this->host = ''; try { @@ -69,7 +67,8 @@ class NewIPAddressWarningMail extends Mailable $this->host = $hostName; } - return $this->view('emails.new-ip-html')->text('emails.new-ip-text') + return $this + ->markdown('emails.new-ip') ->subject((string)trans('email.login_from_new_ip')); } } diff --git a/app/Mail/OAuthTokenCreatedMail.php b/app/Mail/OAuthTokenCreatedMail.php index 495b3b2163..796f980fc4 100644 --- a/app/Mail/OAuthTokenCreatedMail.php +++ b/app/Mail/OAuthTokenCreatedMail.php @@ -37,25 +37,16 @@ class OAuthTokenCreatedMail extends Mailable { use Queueable, SerializesModels; - /** @var Client The client */ - public $client; - /** @var string Email address of admin */ - public $email; - /** @var string IP address of admin */ - public $ipAddress; + public Client $client; /** * OAuthTokenCreatedMail constructor. * - * @param string $email - * @param string $ipAddress * @param Client $client */ - public function __construct(string $email, string $ipAddress, Client $client) + public function __construct(Client $client) { - $this->email = $email; - $this->ipAddress = $ipAddress; - $this->client = $client; + $this->client = $client; } /** @@ -65,7 +56,8 @@ class OAuthTokenCreatedMail extends Mailable */ public function build(): self { - return $this->view('emails.oauth-client-created-html')->text('emails.oauth-client-created-text') - ->subject((string)trans('email.oauth_created_subject')); + return $this + ->markdown('emails.oauth-client-created') + ->subject((string) trans('email.oauth_created_subject')); } } diff --git a/app/Mail/RegisteredUser.php b/app/Mail/RegisteredUser.php index 6bb66a6ece..20f9d91b38 100644 --- a/app/Mail/RegisteredUser.php +++ b/app/Mail/RegisteredUser.php @@ -38,21 +38,16 @@ class RegisteredUser extends Mailable { use Queueable, SerializesModels; - /** @var string Email address of user */ - public $address; - /** @var string IP address of user */ - public $ipAddress; + public string $address; /** * Create a new message instance. * * @param string $address - * @param string $ipAddress */ - public function __construct(string $address, string $ipAddress) + public function __construct(string $address) { $this->address = $address; - $this->ipAddress = $ipAddress; } /** @@ -62,6 +57,8 @@ class RegisteredUser extends Mailable */ public function build(): self { - return $this->view('emails.registered-html')->text('emails.registered-text')->subject((string)trans('email.registered_subject')); + return $this + ->markdown('emails.registered') + ->subject((string)trans('email.registered_subject')); } } diff --git a/app/Mail/ReportNewJournalsMail.php b/app/Mail/ReportNewJournalsMail.php index dd19c46d2b..feff32bdea 100644 --- a/app/Mail/ReportNewJournalsMail.php +++ b/app/Mail/ReportNewJournalsMail.php @@ -40,23 +40,17 @@ class ReportNewJournalsMail extends Mailable { use Queueable, SerializesModels; - public string $email; public Collection $groups; - public string $ipAddress; public array $transformed; /** * ConfirmEmailChangeMail constructor. * - * @param string $email - * @param string $ipAddress * @param Collection $groups */ - public function __construct(string $email, string $ipAddress, Collection $groups) + public function __construct(Collection $groups) { - $this->email = $email; - $this->ipAddress = $ipAddress; - $this->groups = $groups; + $this->groups = $groups; } /** @@ -68,8 +62,9 @@ class ReportNewJournalsMail extends Mailable { $this->transform(); - return $this->view('emails.report-new-journals-html')->text('emails.report-new-journals-text') - ->subject((string)trans_choice('email.new_journals_subject', $this->groups->count())); + return $this + ->markdown('emails.report-new-journals') + ->subject((string) trans_choice('email.new_journals_subject', $this->groups->count())); } private function transform(): void diff --git a/app/Mail/RequestedNewPassword.php b/app/Mail/RequestedNewPassword.php index b02d4ebe69..bbe68adcdc 100644 --- a/app/Mail/RequestedNewPassword.php +++ b/app/Mail/RequestedNewPassword.php @@ -37,21 +37,16 @@ class RequestedNewPassword extends Mailable { use Queueable, SerializesModels; - /** @var string IP address of user */ - public $ipAddress; - /** @var string URI of password change link */ - public $url; + public string $url; /** * RequestedNewPassword constructor. * * @param string $url - * @param string $ipAddress */ - public function __construct(string $url, string $ipAddress) + public function __construct(string $url) { $this->url = $url; - $this->ipAddress = $ipAddress; } /** @@ -61,6 +56,8 @@ class RequestedNewPassword extends Mailable */ public function build(): self { - return $this->view('emails.password-html')->text('emails.password-text')->subject((string)trans('email.reset_pw_subject')); + return $this + ->markdown('emails.password') + ->subject((string)trans('email.reset_pw_subject')); } } diff --git a/app/Mail/UndoEmailChangeMail.php b/app/Mail/UndoEmailChangeMail.php index 647917b1c2..0c76e726a1 100644 --- a/app/Mail/UndoEmailChangeMail.php +++ b/app/Mail/UndoEmailChangeMail.php @@ -35,29 +35,22 @@ class UndoEmailChangeMail extends Mailable { use Queueable, SerializesModels; - /** @var string IP address of user */ - public $ipAddress; - /** @var string New email address */ - public $newEmail; - /** @var string Old email address */ - public $oldEmail; - /** @var string URI to undo */ - public $uri; + public string $newEmail; + public string $oldEmail; + public string $url; /** * UndoEmailChangeMail constructor. * * @param string $newEmail * @param string $oldEmail - * @param string $uri - * @param string $ipAddress + * @param string $url */ - public function __construct(string $newEmail, string $oldEmail, string $uri, string $ipAddress) + public function __construct(string $newEmail, string $oldEmail, string $url) { $this->newEmail = $newEmail; $this->oldEmail = $oldEmail; - $this->uri = $uri; - $this->ipAddress = $ipAddress; + $this->url = $url; } /** @@ -67,7 +60,8 @@ class UndoEmailChangeMail extends Mailable */ public function build(): self { - return $this->view('emails.undo-email-change-html')->text('emails.undo-email-change-text') - ->subject((string)trans('email.email_change_subject')); + return $this + ->markdown('emails.undo-email-change') + ->subject((string)trans('email.email_change_subject')); } } diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index 7a549c66aa..f027a2ec2f 100644 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -179,7 +179,6 @@ class EventServiceProvider extends ServiceProvider } $email = $user->email; - $ipAddress = Request::ip(); // see if user has alternative email address: $pref = app('preferences')->getForUser($user, 'remote_guard_alt_email'); @@ -187,10 +186,10 @@ class EventServiceProvider extends ServiceProvider $email = $pref->data; } - Log::debug(sprintf('Now in EventServiceProvider::registerCreateEvents. Email is %s, IP is %s', $email, $ipAddress)); + Log::debug(sprintf('Now in EventServiceProvider::registerCreateEvents. Email is %s', $email)); try { Log::debug('Trying to send message...'); - Mail::to($email)->send(new OAuthTokenCreatedMail($email, $ipAddress, $oauthClient)); + Mail::to($email)->send(new OAuthTokenCreatedMail($oauthClient)); } catch (Exception $e) { // @phpstan-ignore-line Log::debug('Send message failed! :('); Log::error($e->getMessage()); diff --git a/config/sanctum.php b/config/sanctum.php index e0be740f7b..d9d06126d3 100644 --- a/config/sanctum.php +++ b/config/sanctum.php @@ -1,6 +1,9 @@ [ - 'verify_csrf_token' => \FireflyIII\Http\Middleware\VerifyCsrfToken::class, - 'encrypt_cookies' => \FireflyIII\Http\Middleware\EncryptCookies::class, + 'verify_csrf_token' => VerifyCsrfToken::class, + 'encrypt_cookies' => EncryptCookies::class, ], ]; diff --git a/resources/lang/en_US/email.php b/resources/lang/en_US/email.php index 33123ee252..cf1c77981d 100644 --- a/resources/lang/en_US/email.php +++ b/resources/lang/en_US/email.php @@ -24,97 +24,94 @@ declare(strict_types=1); return [ // common items - 'greeting' => 'Hi there,', - 'closing' => 'Beep boop,', - 'signature' => 'The Firefly III Mail Robot', - 'footer_ps' => 'PS: This message was sent because a request from IP :ipAddress triggered it.', + 'greeting' => 'Hi there,', + 'closing' => 'Beep boop,', + 'signature' => 'The Firefly III Mail Robot', + 'footer_ps' => 'PS: This message was sent because a request from IP :ipAddress triggered it.', // admin test - 'admin_test_subject' => 'A test message from your Firefly III installation', - 'admin_test_body' => 'This is a test message from your Firefly III instance. It was sent to :email.', + 'admin_test_subject' => 'A test message from your Firefly III installation', + 'admin_test_body' => 'This is a test message from your Firefly III instance. It was sent to :email.', // new IP - 'login_from_new_ip' => 'New login on Firefly III', - 'new_ip_body' => 'Firefly III detected a new login on your account from an unknown IP address. If you never logged in from the IP address below, or it has been more than six months ago, Firefly III will warn you.', - 'new_ip_warning' => 'If you recognize this IP address or the login, you can ignore this message. If you didn\'t login, of if you have no idea what this is about, verify your password security, change it, and log out all other sessions. To do this, go to your profile page. Of course you have 2FA enabled already, right? Stay safe!', - 'ip_address' => 'IP address', - 'host_name' => 'Host', - 'date_time' => 'Date + time', + 'login_from_new_ip' => 'New login on Firefly III', + 'new_ip_body' => 'Firefly III detected a new login on your account from an unknown IP address. If you never logged in from the IP address below, or it has been more than six months ago, Firefly III will warn you.', + 'new_ip_warning' => 'If you recognize this IP address or the login, you can ignore this message. If you didn\'t login, of if you have no idea what this is about, verify your password security, change it, and log out all other sessions. To do this, go to your profile page. Of course you have 2FA enabled already, right? Stay safe!', + 'ip_address' => 'IP address', + 'host_name' => 'Host', + 'date_time' => 'Date + time', // access token created - 'access_token_created_subject' => 'A new access token was created', - 'access_token_created_body' => 'Somebody (hopefully you) just created a new Firefly III API Access Token for your user account.', - 'access_token_created_explanation' => 'With this token, they can access all of your financial records through the Firefly III API.', - 'access_token_created_revoke' => 'If this wasn\'t you, please revoke this token as soon as possible at :url.', + 'access_token_created_subject' => 'A new access token was created', + 'access_token_created_body' => 'Somebody (hopefully you) just created a new Firefly III API Access Token for your user account.', + 'access_token_created_explanation' => 'With this token, they can access **all** of your financial records through the Firefly III API.', + 'access_token_created_revoke' => 'If this wasn\'t you, please revoke this token as soon as possible at :url', // registered - 'registered_subject' => 'Welcome to Firefly III!', - 'registered_welcome' => 'Welcome to Firefly III. Your registration has made it, and this email is here to confirm it. Yay!', - 'registered_pw' => 'If you have forgotten your password already, please reset it using the password reset tool.', - 'registered_help' => 'There is a help-icon in the top right corner of each page. If you need help, click it!', - 'registered_doc_html' => 'If you haven\'t already, please read the grand theory.', - 'registered_doc_text' => 'If you haven\'t already, please read the first use guide and the full description.', - 'registered_closing' => 'Enjoy!', - 'registered_firefly_iii_link' => 'Firefly III:', - 'registered_pw_reset_link' => 'Password reset:', - 'registered_doc_link' => 'Documentation:', + 'registered_subject' => 'Welcome to Firefly III!', + 'registered_welcome' => 'Welcome to [Firefly III](:address). Your registration has made it, and this email is here to confirm it. Yay!', + 'registered_pw' => 'If you have forgotten your password already, please reset it using [the password reset tool](:address/password/reset).', + 'registered_help' => 'There is a help-icon in the top right corner of each page. If you need help, click it!', + 'registered_doc_html' => 'If you haven\'t already, please read the [grand theory](https://docs.firefly-iii.org/about-firefly-iii/personal-finances).', + 'registered_doc_text' => 'If you haven\'t already, please also read the first use guide and the full description.', + 'registered_closing' => 'Enjoy!', + 'registered_firefly_iii_link' => 'Firefly III:', + 'registered_pw_reset_link' => 'Password reset:', + 'registered_doc_link' => 'Documentation:', // email change - 'email_change_subject' => 'Your Firefly III email address has changed', - 'email_change_body_to_new' => 'You or somebody with access to your Firefly III account has changed your email address. If you did not expect this message, please ignore and delete it.', - 'email_change_body_to_old' => 'You or somebody with access to your Firefly III account has changed your email address. If you did not expect this to happen, you must follow the "undo"-link below to protect your account!', - 'email_change_ignore' => 'If you initiated this change, you may safely ignore this message.', - 'email_change_old' => 'The old email address was: :email', - 'email_change_old_strong' => 'The old email address was: :email', - 'email_change_new' => 'The new email address is: :email', - 'email_change_new_strong' => 'The new email address is: :email', - 'email_change_instructions' => 'You cannot use Firefly III until you confirm this change. Please follow the link below to do so.', - 'email_change_undo_link' => 'To undo the change, follow this link:', + 'email_change_subject' => 'Your Firefly III email address has changed', + 'email_change_body_to_new' => 'You or somebody with access to your Firefly III account has changed your email address. If you did not expect this message, please ignore and delete it.', + 'email_change_body_to_old' => 'You or somebody with access to your Firefly III account has changed your email address. If you did not expect this to happen, you **must** follow the "undo"-link below to protect your account!', + 'email_change_ignore' => 'If you initiated this change, you may safely ignore this message.', + 'email_change_old' => 'The old email address was: :email', + 'email_change_old_strong' => 'The old email address was: **:email**', + 'email_change_new' => 'The new email address is: :email', + 'email_change_new_strong' => 'The new email address is: **:email**', + 'email_change_instructions' => 'You cannot use Firefly III until you confirm this change. Please follow the link below to do so.', + 'email_change_undo_link' => 'To undo the change, follow this link:', // OAuth token created - 'oauth_created_subject' => 'A new OAuth client has been created', - 'oauth_created_body' => 'Somebody (hopefully you) just created a new Firefly III API OAuth Client for your user account. It\'s labeled ":name" and has callback URL :url.', - 'oauth_created_explanation' => 'With this client, they can access all of your financial records through the Firefly III API.', - 'oauth_created_undo' => 'If this wasn\'t you, please revoke this client as soon as possible at :url.', + 'oauth_created_subject' => 'A new OAuth client has been created', + 'oauth_created_body' => 'Somebody (hopefully you) just created a new Firefly III API OAuth Client for your user account. It\'s labeled ":name" and has callback URL `:url`.', + 'oauth_created_explanation' => 'With this client, they can access **all** of your financial records through the Firefly III API.', + 'oauth_created_undo' => 'If this wasn\'t you, please revoke this client as soon as possible at `:url`', // reset password - 'reset_pw_subject' => 'Your password reset request', - 'reset_pw_instructions' => 'Somebody tried to reset your password. If it was you, please follow the link below to do so.', - 'reset_pw_warning' => 'PLEASE verify that the link actually goes to the Firefly III you expect it to go!', + 'reset_pw_subject' => 'Your password reset request', + 'reset_pw_instructions' => 'Somebody tried to reset your password. If it was you, please follow the link below to do so.', + 'reset_pw_warning' => '**PLEASE** verify that the link actually goes to the Firefly III you expect it to go!', // error - 'error_subject' => 'Caught an error in Firefly III', - 'error_intro' => 'Firefly III v:version ran into an error: :errorMessage.', - 'error_type' => 'The error was of type ":class".', - 'error_timestamp' => 'The error occurred on/at: :time.', - 'error_location' => 'This error occurred in file ":file" on line :line with code :code.', - 'error_user' => 'The error was encountered by user #:id, :email.', - 'error_no_user' => 'There was no user logged in for this error or no user was detected.', - 'error_ip' => 'The IP address related to this error is: :ip', - 'error_url' => 'URL is: :url', - 'error_user_agent' => 'User agent: :userAgent', - 'error_stacktrace' => 'The full stacktrace is below. If you think this is a bug in Firefly III, you can forward this message to james@firefly-iii.org. This can help fix the bug you just encountered.', - 'error_github_html' => 'If you prefer, you can also open a new issue on GitHub.', - 'error_github_text' => 'If you prefer, you can also open a new issue on https://github.com/firefly-iii/firefly-iii/issues.', - 'error_stacktrace_below' => 'The full stacktrace is below:', - 'error_headers' => 'The following headers may also be relevant:', + 'error_subject' => 'Caught an error in Firefly III', + 'error_intro' => 'Firefly III v:version ran into an error: :errorMessage.', + 'error_type' => 'The error was of type ":class".', + 'error_timestamp' => 'The error occurred on/at: :time.', + 'error_location' => 'This error occurred in file ":file" on line :line with code :code.', + 'error_user' => 'The error was encountered by user #:id, :email.', + 'error_no_user' => 'There was no user logged in for this error or no user was detected.', + 'error_ip' => 'The IP address related to this error is: :ip', + 'error_url' => 'URL is: :url', + 'error_user_agent' => 'User agent: :userAgent', + 'error_stacktrace' => 'The full stacktrace is below. If you think this is a bug in Firefly III, you can forward this message to james@firefly-iii.org. This can help fix the bug you just encountered.', + 'error_github_html' => 'If you prefer, you can also open a new issue on GitHub.', + 'error_github_text' => 'If you prefer, you can also open a new issue on https://github.com/firefly-iii/firefly-iii/issues.', + 'error_stacktrace_below' => 'The full stacktrace is below:', + 'error_headers' => 'The following headers may also be relevant:', // report new journals - 'new_journals_subject' => 'Firefly III has created a new transaction|Firefly III has created :count new transactions', - 'new_journals_header' => 'Firefly III has created a transaction for you. You can find it in your Firefly III installation:|Firefly III has created :count transactions for you. You can find them in your Firefly III installation:', + 'new_journals_subject' => 'Firefly III has created a new transaction|Firefly III has created :count new transactions', + 'new_journals_header' => 'Firefly III has created a transaction for you. You can find it in your Firefly III installation:|Firefly III has created :count transactions for you. You can find them in your Firefly III installation:', // bill warning - 'bill_warning_subject_end_date' => 'Your bill ":name" is due to end in :diff days', - 'bill_warning_subject_now_end_date' => 'Your bill ":name" is due to end TODAY', - 'bill_warning_subject_extension_date' => 'Your bill ":name" is due to be extended or cancelled in :diff days', - 'bill_warning_subject_now_extension_date' => 'Your bill ":name" is due to be extended or cancelled TODAY', - 'bill_warning_end_date_text' => 'Your bill ":name" is due to end on :date. This moment will pass in about :diff days.', - 'bill_warning_extension_date_text' => 'Your bill ":name" is due to be extended or cancelled on :date. This moment will pass in about :diff days.', - 'bill_warning_end_date_text_zero' => 'Your bill ":name" is due to end on :date. This moment will pass TODAY!', - 'bill_warning_extension_date_text_zero' => 'Your bill ":name" is due to be extended or cancelled on :date. This moment will pass TODAY!', - 'bill_warning_please_action' => 'Please take the appropriate action.', - 'bill_warning_end_date_html' => 'Your bill ":name" is due to end on :date. This moment will pass in about :diff days.', - 'bill_warning_extension_date_html' => 'Your bill ":name" is due to be extended or cancelled on :date. This moment will pass in about :diff days.', - 'bill_warning_end_date_html_zero' => 'Your bill ":name" is due to end on :date. This moment will pass TODAY!', - 'bill_warning_extension_date_html_zero' => 'Your bill ":name" is due to be extended or cancelled on :date. This moment will pass TODAY!', + 'bill_warning_subject_end_date' => 'Your bill ":name" is due to end in :diff days', + 'bill_warning_subject_now_end_date' => 'Your bill ":name" is due to end TODAY', + 'bill_warning_subject_extension_date' => 'Your bill ":name" is due to be extended or cancelled in :diff days', + 'bill_warning_subject_now_extension_date' => 'Your bill ":name" is due to be extended or cancelled TODAY', + 'bill_warning_end_date' => 'Your bill **":name"** is due to end on :date. This moment will pass in about **:diff days**.', + 'bill_warning_extension_date' => 'Your bill **":name"** is due to be extended or cancelled on :date. This moment will pass in about **:diff days**.', + 'bill_warning_end_date_zero' => 'Your bill **":name"** is due to end on :date. This moment will pass **TODAY!**', + 'bill_warning_extension_date_zero' => 'Your bill **":name"** is due to be extended or cancelled on :date. This moment will pass **TODAY!**', + 'bill_warning_please_action' => 'Please take the appropriate action.', + ]; diff --git a/resources/views/emails/access-token-created-html.twig b/resources/views/emails/access-token-created-html.twig deleted file mode 100644 index ede3a2f044..0000000000 --- a/resources/views/emails/access-token-created-html.twig +++ /dev/null @@ -1,13 +0,0 @@ -{% include 'emails.header-html' %} -
- {{ trans('email.access_token_created_body') }} -
- -- {{ trans('email.access_token_created_explanation')|raw }} -
- -- {{ trans('email.access_token_created_revoke', {url: route('profile.index') }) }} -
-{% include 'emails.footer-html' %} diff --git a/resources/views/emails/access-token-created-text.twig b/resources/views/emails/access-token-created-text.twig deleted file mode 100644 index 04d85cdf35..0000000000 --- a/resources/views/emails/access-token-created-text.twig +++ /dev/null @@ -1,7 +0,0 @@ -{% include 'emails.header-text' %} -{{ trans('email.access_token_created_body')|raw }} - -{{ trans('email.access_token_created_explanation')|striptags|raw }} - -{{ trans('email.access_token_created_revoke', {url: route('profile.index') })|raw }} -{% include 'emails.footer-text' %} diff --git a/resources/views/emails/admin-test-html.twig b/resources/views/emails/admin-test-html.twig deleted file mode 100644 index 6d343085b8..0000000000 --- a/resources/views/emails/admin-test-html.twig +++ /dev/null @@ -1,5 +0,0 @@ -{% include 'emails.header-html' %} -- {{ trans('email.admin_test_body', {email: email })}} -
-{% include 'emails.footer-html' %} diff --git a/resources/views/emails/admin-test-text.twig b/resources/views/emails/admin-test-text.twig deleted file mode 100644 index e6c5aca702..0000000000 --- a/resources/views/emails/admin-test-text.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% include 'emails.header-text' %} -{{ trans('email.admin_test_body', {email: email })|raw }} -{% include 'emails.footer-text' %} diff --git a/resources/views/emails/admin-test.blade.php b/resources/views/emails/admin-test.blade.php new file mode 100644 index 0000000000..ed533258a2 --- /dev/null +++ b/resources/views/emails/admin-test.blade.php @@ -0,0 +1,3 @@ +@component('mail::message') +{{ trans('email.admin_test_body', ['email' => $email]) }} +@endcomponent diff --git a/resources/views/emails/bill-warning-html.twig b/resources/views/emails/bill-warning-html.twig deleted file mode 100644 index 9d01d8d07e..0000000000 --- a/resources/views/emails/bill-warning-html.twig +++ /dev/null @@ -1,25 +0,0 @@ -{% include 'emails.header-html' %} - -- - {% if field == 'end_date' and diff != 0 %} - {{ trans('email.bill_warning_end_date_html', {name: bill.name|escape, date: bill.end_date.isoFormat(trans('config.month_and_day_js')), diff: diff})|raw }} - {% endif %} - {% if field == 'extension_date' and diff != 0 %} - {{ trans('email.bill_warning_extension_date_html', {name: bill.name|escape, date: bill.extension_date.isoFormat(trans('config.month_and_day_js')), diff: diff})|raw }} - {% endif %} - {% if field == 'end_date' and diff == 0 %} - {{ trans('email.bill_warning_end_date_html_zero', {name: bill.name|escape, date: bill.end_date.isoFormat(trans('config.month_and_day_js'))})|raw }} - {% endif %} - {% if field == 'extension_date' and diff == 0 %} - {{ trans('email.bill_warning_extension_date_html_zero', {name: bill.name|escape, date: bill.end_date.isoFormat(trans('config.month_and_day_js'))})|raw }} - {% endif %} - -
- -- Please take the appropriate action. -
- - -{% include 'emails.footer-html' %} \ No newline at end of file diff --git a/resources/views/emails/bill-warning-text.twig b/resources/views/emails/bill-warning-text.twig deleted file mode 100644 index c76b64fb96..0000000000 --- a/resources/views/emails/bill-warning-text.twig +++ /dev/null @@ -1,17 +0,0 @@ -{% include 'emails.header-text' %} -{% if field == 'end_date' and diff != 0 %} -{{ trans('email.bill_warning_end_date_text', {name: bill.name, date: bill.end_date.isoFormat(trans('config.month_and_day_js')), diff: diff})|raw }} -{% endif %} -{% if field == 'extension_date' and diff != 0 %} -{{ trans('email.bill_warning_extension_date_text', {name: bill.name|escape, date: bill.extension_date.isoFormat(trans('config.month_and_day_js')), diff: diff})|raw }} -{% endif %} -{% if field == 'end_date' and diff == 0 %} -{{ trans('email.bill_warning_end_date_text_zero', {name: bill.name|escape, date: bill.end_date.isoFormat(trans('config.month_and_day_js'))})|raw }} -{% endif %} -{% if field == 'extension_date' and diff == 0 %} -{{ trans('email.bill_warning_extension_date_text_zero', {name: bill.name|escape, date: bill.end_date.isoFormat(trans('config.month_and_day_js'))})|raw }} -{% endif %} - -{{ trans('email.bill_warning_please_action') }} - -{% include 'emails.footer-text' %} \ No newline at end of file diff --git a/resources/views/emails/bill-warning.blade.php b/resources/views/emails/bill-warning.blade.php new file mode 100644 index 0000000000..1b3704bb30 --- /dev/null +++ b/resources/views/emails/bill-warning.blade.php @@ -0,0 +1,20 @@ +@component('mail::message') +@if($field === 'end_date' && $diff !== 0) +{{ trans('email.bill_warning_end_date', ['name' => $bill->name, 'date' => $bill->end_date->isoFormat(trans('config.month_and_day_js')), 'diff' => $diff]) }} +@endif + +@if($field === 'extension_date' && $diff !== 0) +{{ trans('email.bill_warning_extension_date', ['name' => $bill->name, 'date' => $bill->end_date->isoFormat(trans('config.month_and_day_js')), 'diff' => $diff]) }} +@endif + +@if($field === 'end_date' && $diff === 0) +{{ trans('email.bill_warning_end_date_zero', ['name' => $bill->name, 'date' => $bill->end_date->isoFormat(trans('config.month_and_day_js')) ]) }} +@endif + +@if($field === 'extension_date' && $diff === 0) +{{ trans('email.bill_warning_extension_date_zero', ['name' => $bill->name, 'date' => $bill->end_date->isoFormat(trans('config.month_and_day_js')) ]) }} +@endif + +{{ trans('email.bill_warning_please_action') }} + +@endcomponent diff --git a/resources/views/emails/confirm-email-change-html.twig b/resources/views/emails/confirm-email-change-html.twig deleted file mode 100644 index 7eb907c421..0000000000 --- a/resources/views/emails/confirm-email-change-html.twig +++ /dev/null @@ -1,18 +0,0 @@ -{% include 'emails.header-html' %} -- {{ trans('email.email_change_body_to_new')}} -
-- {{trans('email.email_change_old', { email: oldEmail }) }} -
-- {{trans('email.email_change_new_strong', { email: newEmail })|raw }} -
-- {{ trans('email.email_change_instructions')}} -
- -- {{ uri }} -
-{% include 'emails.footer-html' %} diff --git a/resources/views/emails/confirm-email-change-text.twig b/resources/views/emails/confirm-email-change-text.twig deleted file mode 100644 index 1fd8695814..0000000000 --- a/resources/views/emails/confirm-email-change-text.twig +++ /dev/null @@ -1,10 +0,0 @@ -{% include 'emails.header-text' %} -{{ trans('email.email_change_body_to_new')|raw }} - -{{trans('email.email_change_old', { email: oldEmail })|raw }} - -{{trans('email.email_change_new', { email: newEmail })|raw }} - -{{ trans('email.email_change_instructions')|raw }} -{{ uri }} -{% include 'emails.footer-text' %} diff --git a/resources/views/emails/confirm-email-change.blade.php b/resources/views/emails/confirm-email-change.blade.php new file mode 100644 index 0000000000..ceab5fb2b8 --- /dev/null +++ b/resources/views/emails/confirm-email-change.blade.php @@ -0,0 +1,11 @@ +@component('mail::message') +{{ trans('email.email_change_body_to_new') }} + +{{trans('email.email_change_old', ['email' => $oldEmail]) }} + +{{trans('email.email_change_new', ['email' => $newEmail]) }} + +{{ trans('email.email_change_instructions') }} + +{{ $url }} +@endcomponent diff --git a/resources/views/emails/new-ip-html.twig b/resources/views/emails/new-ip-html.twig deleted file mode 100644 index 7c0c56e6b0..0000000000 --- a/resources/views/emails/new-ip-html.twig +++ /dev/null @@ -1,16 +0,0 @@ -{% include 'emails.header-html' %} -- {{ trans('email.new_ip_body') }} -
- -
- {{ trans('email.ip_address') }}: {{ ipAddress }}
- {% if ''!= host %}{{ trans('email.host_name') }}: {{ host }}
{% endif %}
- {{ trans('email.date_time') }}: {{ time }}
-
- {{ trans('email.new_ip_warning') }} -
- -{% include 'emails.footer-html' %} diff --git a/resources/views/emails/new-ip-text.twig b/resources/views/emails/new-ip-text.twig deleted file mode 100644 index b5b55dfe4a..0000000000 --- a/resources/views/emails/new-ip-text.twig +++ /dev/null @@ -1,10 +0,0 @@ -{% include 'emails.header-text' %} -{{ trans('email.new_ip_body') }} - -{{ trans('email.ip_address') }}: {{ ipAddress }} -{% if ''!= host %}{{ trans('email.host_name') }}: {{ host }}{% endif %} -{{ trans('email.date_time') }}: {{ time }} - -{{ trans('email.new_ip_warning') }} - -{% include 'emails.footer-text' %} diff --git a/resources/views/emails/new-ip.blade.php b/resources/views/emails/new-ip.blade.php new file mode 100644 index 0000000000..446f1c7ae8 --- /dev/null +++ b/resources/views/emails/new-ip.blade.php @@ -0,0 +1,13 @@ +@component('mail::message') +{{ trans('email.new_ip_body') }} + +{{ trans('email.ip_address') }}: {{ $ipAddress }} + +@if('' !== $host) +{{ trans('email.host_name') }}: {{ $host }} +@endif + +{{ trans('email.date_time') }}: {{ $time }} + +{{ trans('email.new_ip_warning') }} +@endcomponent diff --git a/resources/views/emails/oauth-client-created-html.twig b/resources/views/emails/oauth-client-created-html.twig deleted file mode 100644 index 03906957f1..0000000000 --- a/resources/views/emails/oauth-client-created-html.twig +++ /dev/null @@ -1,13 +0,0 @@ -{% include 'emails.header-html' %} -- {{ trans('email.oauth_created_body', { name:client.name, url: client.redirect })|raw }} -
- -- {{ trans('email.oauth_created_explanation')|raw }} -
- -- {{ trans('email.oauth_created_undo', { url:route('profile.index')}) }} -
-{% include 'emails.footer-html' %} diff --git a/resources/views/emails/oauth-client-created-text.twig b/resources/views/emails/oauth-client-created-text.twig deleted file mode 100644 index 566f2ad89b..0000000000 --- a/resources/views/emails/oauth-client-created-text.twig +++ /dev/null @@ -1,7 +0,0 @@ -{% include 'emails.header-text' %} -{{ trans('email.oauth_created_body', {name: client.name, url: client.redirect })|striptags|raw }} - -{{ trans('email.oauth_created_explanation')|striptags|raw }} - -{{ trans('email.oauth_created_undo', { url:route('profile.index')})|raw }} -{% include 'emails.footer-text' %} diff --git a/resources/views/emails/oauth-client-created.blade.php b/resources/views/emails/oauth-client-created.blade.php new file mode 100644 index 0000000000..4041c8495e --- /dev/null +++ b/resources/views/emails/oauth-client-created.blade.php @@ -0,0 +1,8 @@ +@component('mail::message') +{{ trans('email.oauth_created_body', ['name' => $client->name, 'url' => $client->redirect]) }} + +{{ trans('email.oauth_created_explanation') }} + +{{ trans('email.oauth_created_undo', ['url' => route('profile.index')] ) }} + +@endcomponent diff --git a/resources/views/emails/password-html.twig b/resources/views/emails/password-html.twig deleted file mode 100644 index 2f020fb924..0000000000 --- a/resources/views/emails/password-html.twig +++ /dev/null @@ -1,13 +0,0 @@ -{% include 'emails.header-html' %} -- {{ trans('email.reset_pw_instructions') }} -
- -- {{ trans('email.reset_pw_warning')|raw }} -
- -- {{ url }} -
-{% include 'emails.footer-html' %} diff --git a/resources/views/emails/password-text.twig b/resources/views/emails/password-text.twig deleted file mode 100644 index 258521ea99..0000000000 --- a/resources/views/emails/password-text.twig +++ /dev/null @@ -1,7 +0,0 @@ -{% include 'emails.header-text' %} -{{ trans('email.reset_pw_instructions')|raw }} - -{{ trans('email.reset_pw_warning')|striptags|raw }} - -{{ url }} -{% include 'emails.footer-text' %} diff --git a/resources/views/emails/password.blade.php b/resources/views/emails/password.blade.php new file mode 100644 index 0000000000..926ed49e32 --- /dev/null +++ b/resources/views/emails/password.blade.php @@ -0,0 +1,8 @@ +@component('mail::message') +{{ trans('email.reset_pw_instructions') }} + +{{ trans('email.reset_pw_warning') }} + +{{ $url }} + +@endcomponent diff --git a/resources/views/emails/registered-html.twig b/resources/views/emails/registered-html.twig deleted file mode 100644 index 78d8b1052e..0000000000 --- a/resources/views/emails/registered-html.twig +++ /dev/null @@ -1,20 +0,0 @@ -{% include 'emails.header-html' %} -- {{ trans('email.registered_welcome', {address: address})|raw }} -
- -- {{ trans('email.registered_closing')}} -
-{% include 'emails.footer-html' %} diff --git a/resources/views/emails/registered-text.twig b/resources/views/emails/registered-text.twig deleted file mode 100644 index 78c696b065..0000000000 --- a/resources/views/emails/registered-text.twig +++ /dev/null @@ -1,21 +0,0 @@ -{% include 'emails.header-text' %} - -{{ trans('email.registered_welcome')|striptags|raw }} - -* {{ trans('email.registered_pw')|striptags|raw }} -* {{ trans('email.registered_help')|raw }} -* {{ trans('email.registered_doc_text')|raw }} - -{{ trans('email.registered_closing')|raw }} - -{{ trans('email.registered_firefly_iii_link')|raw }} -{{ address }} - -{{ trans('email.registered_pw_reset_link')|raw }} -{{ address }}/password/reset - -{{ trans('email.registered_doc_link')}} -https://github.com/firefly-iii/firefly-iii -https://firefly-iii.org/ - -{% include 'emails.footer-text' %} diff --git a/resources/views/emails/registered.blade.php b/resources/views/emails/registered.blade.php new file mode 100644 index 0000000000..e4a4032838 --- /dev/null +++ b/resources/views/emails/registered.blade.php @@ -0,0 +1,14 @@ +@component('mail::message') +{{ trans('email.registered_welcome') }} + +* {{ trans('email.registered_pw', ['address' => $address]) }} +* {{ trans('email.registered_help') }} +* {{ trans('email.registered_doc_text') }} + +{{ trans('email.registered_closing') }} + +* {{ trans('email.registered_firefly_iii_link')}} [{{$address }}]({{$address }}) +* {{ trans('email.registered_pw_reset_link')}} [{{ $address }}/password/reset]({{ $address }}/password/reset) +* {{ trans('email.registered_doc_link')}} [https://docs.firefly-iii.org/](https://docs.firefly-iii.org/) + +@endcomponent diff --git a/resources/views/emails/report-new-journals-html.twig b/resources/views/emails/report-new-journals-html.twig deleted file mode 100644 index f423c8d87d..0000000000 --- a/resources/views/emails/report-new-journals-html.twig +++ /dev/null @@ -1,78 +0,0 @@ -{% include 'emails.header-html' %} -- {{ trans_choice('email.new_journals_header', transformed|length ) }} -
- - -- {{ trans('email.email_change_body_to_old')|raw }} -
-- {{ trans('email.email_change_ignore') }} -
-- {{trans('email.email_change_old_strong', { email: oldEmail })|raw }} -
-- {{trans('email.email_change_new', { email: newEmail }) }} -
-- {{trans('email.email_change_undo_link')}} {{ uri }} -
-{% include 'emails.footer-html' %} diff --git a/resources/views/emails/undo-email-change-text.twig b/resources/views/emails/undo-email-change-text.twig deleted file mode 100644 index 2c719b9e4d..0000000000 --- a/resources/views/emails/undo-email-change-text.twig +++ /dev/null @@ -1,11 +0,0 @@ -{% include 'emails.header-text' %} -{{ trans('email.email_change_body_to_old')|striptags|raw }} - -{{ trans('email.email_change_ignore')|raw }} - -{{trans('email.email_change_old', { email: oldEmail })|raw }} - -{{trans('email.email_change_new', { email: newEmail })|raw }} - -{{ trans('email.email_change_undo_link')|raw }} {{ uri }} -{% include 'emails.footer-text' %} diff --git a/resources/views/emails/undo-email-change.blade.php b/resources/views/emails/undo-email-change.blade.php new file mode 100644 index 0000000000..9163b13365 --- /dev/null +++ b/resources/views/emails/undo-email-change.blade.php @@ -0,0 +1,11 @@ +@component('mail::message') +{{ trans('email.email_change_body_to_old') }} + +{{ trans('email.email_change_ignore')}} + +{{trans('email.email_change_old', ['email' => $oldEmail]) }} + +{{trans('email.email_change_new', ['email' => $newEmail]) }} + +{{ trans('email.email_change_undo_link') }} {{ $url }} +@endcomponent diff --git a/resources/views/vendor/mail/html/button.blade.php b/resources/views/vendor/mail/html/button.blade.php new file mode 100644 index 0000000000..e74fe55a71 --- /dev/null +++ b/resources/views/vendor/mail/html/button.blade.php @@ -0,0 +1,19 @@ +
+
|
+
+{{ Illuminate\Mail\Markdown::parse($slot) }} + | +
+
|
+
+
|
+
+{{ Illuminate\Mail\Markdown::parse($slot) }} + | +