mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
Fixes for notification gates
This commit is contained in:
parent
89a271e59c
commit
9c4a223923
@ -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]);
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user