Import statements and update configuration.

This commit is contained in:
James Cole
2025-05-27 16:57:36 +02:00
parent 7c04c4c2bc
commit c074fec0a7
165 changed files with 530 additions and 335 deletions

View File

@@ -28,6 +28,7 @@ use FireflyIII\Notifications\User\NewAccessToken;
use FireflyIII\Repositories\User\UserRepositoryInterface;
use Illuminate\Support\Facades\Notification;
use Laravel\Passport\Events\AccessTokenCreated;
use Exception;
/**
* Class APIEventHandler
@@ -48,7 +49,7 @@ class APIEventHandler
if (null !== $user) {
try {
Notification::send($user, new NewAccessToken());
} catch (\Exception $e) {
} catch (Exception $e) {
$message = $e->getMessage();
if (str_contains($message, 'Bcc')) {
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');

View File

@@ -37,6 +37,7 @@ use FireflyIII\Notifications\Test\OwnerTestNotificationPushover;
use FireflyIII\Notifications\Test\OwnerTestNotificationSlack;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Notification;
use Exception;
/**
* Class AdminEventHandler.
@@ -52,7 +53,7 @@ class AdminEventHandler
try {
Notification::send(new OwnerNotifiable(), new UserInvitation($event->invitee));
} catch (\Exception $e) {
} catch (Exception $e) {
$message = $e->getMessage();
if (str_contains($message, 'Bcc')) {
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
@@ -74,7 +75,7 @@ class AdminEventHandler
try {
$owner = new OwnerNotifiable();
Notification::send($owner, new UnknownUserLoginAttempt($event->address));
} catch (\Exception $e) {
} catch (Exception $e) {
$message = $e->getMessage();
if (str_contains($message, 'Bcc')) {
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
@@ -104,7 +105,7 @@ class AdminEventHandler
try {
$owner = new OwnerNotifiable();
Notification::send($owner, new VersionCheckResult($event->message));
} catch (\Exception $e) {
} catch (Exception $e) {
$message = $e->getMessage();
if (str_contains($message, 'Bcc')) {
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
@@ -158,7 +159,7 @@ class AdminEventHandler
try {
Notification::send($event->owner, new $class());
} catch (\Exception $e) {
} catch (Exception $e) {
$message = $e->getMessage();
if (str_contains($message, 'Bcc')) {
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');

View File

@@ -31,6 +31,7 @@ use FireflyIII\Notifications\User\TransactionCreation;
use FireflyIII\Repositories\User\UserRepositoryInterface;
use FireflyIII\Transformers\TransactionGroupTransformer;
use Illuminate\Support\Facades\Notification;
use Exception;
/**
* Class AutomationHandler
@@ -78,7 +79,7 @@ class AutomationHandler
try {
Notification::send($user, new TransactionCreation($groups));
} catch (\Exception $e) {
} catch (Exception $e) {
$message = $e->getMessage();
if (str_contains($message, 'Bcc')) {
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');

View File

@@ -27,6 +27,7 @@ namespace FireflyIII\Handlers\Events;
use FireflyIII\Events\WarnUserAboutBill;
use FireflyIII\Notifications\User\BillReminder;
use Illuminate\Support\Facades\Notification;
use Exception;
/**
* Class BillEventHandler
@@ -47,7 +48,7 @@ class BillEventHandler
try {
Notification::send($bill->user, new BillReminder($bill, $event->field, $event->diff));
} catch (\Exception $e) {
} catch (Exception $e) {
$message = $e->getMessage();
if (str_contains($message, 'Bcc')) {
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');

View File

@@ -39,6 +39,7 @@ use FireflyIII\Notifications\Security\MFAManyFailedAttemptsNotification;
use FireflyIII\Notifications\Security\MFAUsedBackupCodeNotification;
use FireflyIII\Notifications\Security\NewBackupCodesNotification;
use Illuminate\Support\Facades\Notification;
use Exception;
class MFAHandler
{
@@ -51,7 +52,7 @@ class MFAHandler
try {
Notification::send($user, new MFABackupFewLeftNotification($user, $count));
} catch (\Exception $e) {
} catch (Exception $e) {
$message = $e->getMessage();
if (str_contains($message, 'Bcc')) {
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
@@ -76,7 +77,7 @@ class MFAHandler
try {
Notification::send($user, new MFABackupNoLeftNotification($user));
} catch (\Exception $e) {
} catch (Exception $e) {
$message = $e->getMessage();
if (str_contains($message, 'Bcc')) {
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
@@ -101,7 +102,7 @@ class MFAHandler
try {
Notification::send($user, new DisabledMFANotification($user));
} catch (\Exception $e) {
} catch (Exception $e) {
$message = $e->getMessage();
if (str_contains($message, 'Bcc')) {
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
@@ -126,7 +127,7 @@ class MFAHandler
try {
Notification::send($user, new EnabledMFANotification($user));
} catch (\Exception $e) {
} catch (Exception $e) {
$message = $e->getMessage();
if (str_contains($message, 'Bcc')) {
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
@@ -152,7 +153,7 @@ class MFAHandler
try {
Notification::send($user, new MFAManyFailedAttemptsNotification($user, $count));
} catch (\Exception $e) {
} catch (Exception $e) {
$message = $e->getMessage();
if (str_contains($message, 'Bcc')) {
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
@@ -177,7 +178,7 @@ class MFAHandler
try {
Notification::send($user, new NewBackupCodesNotification($user));
} catch (\Exception $e) {
} catch (Exception $e) {
$message = $e->getMessage();
if (str_contains($message, 'Bcc')) {
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
@@ -202,7 +203,7 @@ class MFAHandler
try {
Notification::send($user, new MFAUsedBackupCodeNotification($user));
} catch (\Exception $e) {
} catch (Exception $e) {
$message = $e->getMessage();
if (str_contains($message, 'Bcc')) {
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');

View File

@@ -56,6 +56,7 @@ use Illuminate\Auth\Events\Login;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Mail;
use Illuminate\Support\Facades\Notification;
use Exception;
/**
* Class UserEventHandler.
@@ -203,7 +204,7 @@ class UserEventHandler
if (false === $entry['notified']) {
try {
Notification::send($user, new UserLogin());
} catch (\Exception $e) {
} catch (Exception $e) {
$message = $e->getMessage();
if (str_contains($message, 'Bcc')) {
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
@@ -233,7 +234,7 @@ class UserEventHandler
try {
Notification::send($owner, new AdminRegistrationNotification($event->user));
} catch (\Exception $e) {
} catch (Exception $e) {
$message = $e->getMessage();
if (str_contains($message, 'Bcc')) {
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
@@ -267,7 +268,7 @@ class UserEventHandler
try {
Mail::to($newEmail)->send(new ConfirmEmailChangeMail($newEmail, $oldEmail, $url));
} catch (\Exception $e) {
} catch (Exception $e) {
app('log')->error($e->getMessage());
app('log')->error($e->getTraceAsString());
@@ -292,7 +293,7 @@ class UserEventHandler
try {
Mail::to($oldEmail)->send(new UndoEmailChangeMail($newEmail, $oldEmail, $url));
} catch (\Exception $e) {
} catch (Exception $e) {
app('log')->error($e->getMessage());
app('log')->error($e->getTraceAsString());
@@ -304,7 +305,7 @@ class UserEventHandler
{
try {
Notification::send($event->user, new UserFailedLoginAttempt($event->user));
} catch (\Exception $e) {
} catch (Exception $e) {
$message = $e->getMessage();
if (str_contains($message, 'Bcc')) {
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
@@ -328,7 +329,7 @@ class UserEventHandler
{
try {
Notification::send($event->user, new UserNewPassword(route('password.reset', [$event->token])));
} catch (\Exception $e) {
} catch (Exception $e) {
$message = $e->getMessage();
if (str_contains($message, 'Bcc')) {
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
@@ -356,7 +357,7 @@ class UserEventHandler
try {
Mail::to($invitee)->send(new InvitationMail($invitee, $admin, $url));
} catch (\Exception $e) {
} catch (Exception $e) {
app('log')->error($e->getMessage());
app('log')->error($e->getTraceAsString());
@@ -374,7 +375,7 @@ class UserEventHandler
if ($sendMail) {
try {
Notification::send($event->user, new UserRegistrationNotification());
} catch (\Exception $e) {
} catch (Exception $e) {
$message = $e->getMessage();
if (str_contains($message, 'Bcc')) {
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
@@ -429,7 +430,7 @@ class UserEventHandler
try {
Notification::send($event->user, new $class());
} catch (\Exception $e) {
} catch (Exception $e) {
$message = $e->getMessage();
if (str_contains($message, 'Bcc')) {
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');