| @@ -61,8 +61,16 @@ | ||
| 61 | 61 | } |
| 62 | 62 | } |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | + // A manually recorded payment (PaymentService) fires this same action | |
| 66 | + // with `send_emails` => false when an operator opted out via the | |
| 67 | + // `yatra_send_manual_payment_emails` filter; the event still reaches | |
| 68 | + // every other listener (automations, webhooks, …). | |
| 69 | + if (isset($paymentData['send_emails']) && !$paymentData['send_emails']) { | |
| 70 | + return; | |
| 71 | + } | |
| 72 | + | |
| 65 | 73 | if (!empty($paymentData)) { |
| 66 | 74 | NotificationService::sendPaymentCompletedNotification($paymentData); |
| 67 | 75 | } |
| 68 | 76 | } |