Disable recurring invoice payment notifications
This commit is contained in:
parent
9112e69cfe
commit
b70b3c76d8
|
|
@ -110,6 +110,13 @@ class PaymentNotification implements ShouldQueue
|
|||
if (($key = array_search('mail', $methods)) !== false) {
|
||||
unset($methods[$key]);
|
||||
|
||||
//new check, IF the payment is on a recurring invoice AND the user had notifications disabled for recurring invoices. then we disable the notification for this payment.
|
||||
$disabled_recurring_invoice_notifications = $this->findUserEntityNotificationType($payment, $company_user,['disable_recurring_payment_notification']);
|
||||
|
||||
if ($payment->invoices->first()->recurring_id && (array_search('mail', $disabled_recurring_invoice_notifications) !== false)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$nmo = new NinjaMailerObject();
|
||||
$nmo->mailable = new NinjaMailer((new EntityPaidObject($payment, $company_user->portalType()))->build());
|
||||
$nmo->company = $event->company;
|
||||
|
|
|
|||
|
|
@ -5591,6 +5591,8 @@ $lang = array(
|
|||
'docuninja_disable_warning' => 'This will remove all access to your DocuNinja account.',
|
||||
'docuninja_downgrade_info' => 'Your user limit will automatically be reduced at the end of the current billing cycle.',
|
||||
'recurring_invoice_item' => 'Recurring Invoice Item',
|
||||
'disable_recurring_payment_notification' => 'Disable Recurring Payment Notification',
|
||||
'disable_recurring_payment_notification_help' => 'Successful recurring invoice payment notifications will not be sent.',
|
||||
);
|
||||
|
||||
return $lang;
|
||||
|
|
|
|||
Loading…
Reference in New Issue