mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 05:04:30 -04:00
Fixes for payment failure mailers
This commit is contained in:
parent
f6f9e7a7a1
commit
9086b224ce
@ -83,7 +83,9 @@ class PaymentFailedMailer implements ShouldQueue
|
|||||||
$this->company->company_users->each(function ($company_user) use($amount, $settings){
|
$this->company->company_users->each(function ($company_user) use($amount, $settings){
|
||||||
|
|
||||||
//determine if this user has the right permissions
|
//determine if this user has the right permissions
|
||||||
$methods = $this->findCompanyUserNotificationType($company_user, ['payment_failure','all_notifications']);
|
// $methods = $this->findCompanyUserNotificationType($company_user, ['payment_failure_all','payment_failure','all_notifications']);
|
||||||
|
|
||||||
|
$methods = $this->findUserEntityNotificationType($this->client, $company_user, ['payment_failure_all','payment_failure','all_notifications']);
|
||||||
|
|
||||||
//if mail is a method type -fire mail!!
|
//if mail is a method type -fire mail!!
|
||||||
if (($key = array_search('mail', $methods)) !== false) {
|
if (($key = array_search('mail', $methods)) !== false) {
|
||||||
|
@ -80,7 +80,7 @@ class PaymentFailureMailer implements ShouldQueue
|
|||||||
$this->company->company_users->each(function ($company_user) {
|
$this->company->company_users->each(function ($company_user) {
|
||||||
|
|
||||||
//determine if this user has the right permissions
|
//determine if this user has the right permissions
|
||||||
$methods = $this->findCompanyUserNotificationType($company_user, ['payment_failure','all_notifications']);
|
$methods = $this->findCompanyUserNotificationType($company_user, ['payment_failure_all','payment_failure','all_notifications']);
|
||||||
|
|
||||||
//if mail is a method type -fire mail!!
|
//if mail is a method type -fire mail!!
|
||||||
if (($key = array_search('mail', $methods)) !== false) {
|
if (($key = array_search('mail', $methods)) !== false) {
|
||||||
|
@ -79,6 +79,12 @@ trait UserNotifies
|
|||||||
$notifiable_methods = [];
|
$notifiable_methods = [];
|
||||||
$notifications = $company_user->notifications;
|
$notifications = $company_user->notifications;
|
||||||
|
|
||||||
|
nlog($company_user->notifications);
|
||||||
|
nlog($required_permissions);
|
||||||
|
nlog(count(array_intersect($required_permissions, ['all_user_notifications'])));
|
||||||
|
nlog(count(array_intersect($required_permissions, ['all_notifications'])));
|
||||||
|
|
||||||
|
nlog(count(array_intersect($required_permissions, $notifications->email)));
|
||||||
//conditional to define whether the company user has the required notification for the MAIL notification TYPE
|
//conditional to define whether the company user has the required notification for the MAIL notification TYPE
|
||||||
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($required_permissions, ['all_user_notifications'])) >= 1 || count(array_intersect($required_permissions, ['all_notifications'])) >= 1) {
|
||||||
array_push($notifiable_methods, 'mail');
|
array_push($notifiable_methods, 'mail');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user