diff --git a/app/Listeners/Payment/PaymentNotification.php b/app/Listeners/Payment/PaymentNotification.php index 1876074ba1ca..97861e362750 100644 --- a/app/Listeners/Payment/PaymentNotification.php +++ b/app/Listeners/Payment/PaymentNotification.php @@ -59,7 +59,7 @@ class PaymentNotification implements ShouldQueue foreach ($payment->company->company_users as $company_user) { $user = $company_user->user; - $methods = $this->findUserEntityNotificationType($payment, $company_user, ['payment_success_all', 'all_notifications']); + $methods = $this->findUserEntityNotificationType($payment, $company_user, ['payment_success', 'payment_success_all', 'all_notifications']); if (($key = array_search('mail', $methods)) !== false) { unset($methods[$key]); diff --git a/app/Utils/Traits/Notifications/UserNotifies.php b/app/Utils/Traits/Notifications/UserNotifies.php index efff7001004f..857ad2eb1418 100644 --- a/app/Utils/Traits/Notifications/UserNotifies.php +++ b/app/Utils/Traits/Notifications/UserNotifies.php @@ -38,8 +38,6 @@ trait UserNotifies array_push($notifiable_methods, 'mail'); } -nlog($notifiable_methods); - // if(count(array_intersect($required_permissions, $notifications->slack)) >=1) // array_push($notifiable_methods, 'slack'); @@ -63,10 +61,11 @@ nlog($notifiable_methods); array_push($required_permissions, 'all_user_notifications'); } - if (count(array_intersect($required_permissions, $notifications->email)) >= 1 || count(array_intersect($required_permissions, ['all_user_notifications'])) >= 1 || count(array_intersect($required_permissions, ['all_notifications'])) >= 1) { + if (count(array_intersect($required_permissions, $notifications->email)) >= 1 || count(array_intersect(['all_user_notifications'], $notifications->email)) >= 1 || count(array_intersect(['all_notifications'],$notifications->email)) >= 1) { array_push($notifiable_methods, 'mail'); } + return $notifiable_methods; }