Skip to content

Firefly III: a personal finances manager

Add debug for the notification channel thing.

James Colec08e3c8797c4
diff --git a/app/Http/Controllers/Admin/NotificationController.php b/app/Http/Controllers/Admin/NotificationController.php
index 94b8241487..a4c4c0c976 100644
--- a/app/Http/Controllers/Admin/NotificationController.php
+++ b/app/Http/Controllers/Admin/NotificationController.php
@@ -129,7 +129,7 @@ final class NotificationController extends Controller
if ((time() - $lastNotification) < 120) {
session()->flash('error', (string) trans('firefly.test_rate_limited'));
- return redirect(route('settings.notification.index'));
+ return redirect(route('settings.notification.index'));
}
$all = $request->only(['test_submit']);
diff --git a/app/Notifications/NotificationSender.php b/app/Notifications/NotificationSender.php
index 21dc2694d2..af7ebf1f9d 100644
--- a/app/Notifications/NotificationSender.php
+++ b/app/Notifications/NotificationSender.php
@@ -35,7 +35,7 @@ use Illuminate\Support\Facades\Notification as NotificationFacade;
class NotificationSender
{
- public static function send(OwnerNotifiable|User $user, Notification $notification): void
+ public static function send(OwnerNotifiable | User $user, Notification $notification): void
{
// ::locale($user->locale))
$lang = config('firefly.default_language');
@@ -45,6 +45,17 @@ class NotificationSender
Log::debug(sprintf('Notification send language set to "%s"', $lang));
}
+ if ((in_array('email', $notification->broadcastOn() ) || 0 === count($notification->broadCastOn())) && 'smtp' === config('mail.default')) {
+ Log::debug(
+ sprintf('Trying to send notification %s via "%s:%s" using encryption "%s" with username "%s" to "%s".',
+ get_class($notification),
+ config('mail.mailers.smtp.host'),
+ config('mail.mailers.smtp.port'),
+ config('mail.mailers.smtp.encryption'),
+ config('mail.mailers.smtp.username'),
+ $user instanceof OwnerNotifiable ? config('firefly.site_owner') : $user->email,
+ ));
+ }
try {
NotificationFacade::locale($lang)->send($user, $notification);
} catch (ClientException $e) {