Chore: Updates to Notifications
This commit is contained in:
@@ -44,6 +44,17 @@ class NotificationRegistry
|
||||
if (isset($event->delaySeconds) && $event->delaySeconds > 0) {
|
||||
$notification->delay($event->delaySeconds);
|
||||
}
|
||||
// Every order-notification event carries ->order, whose
|
||||
// ->meta['locale'] was saved at checkout (Checkout\
|
||||
// Services\CheckoutService::initiatePayment()) — the
|
||||
// request that actually sends this may have no locale of
|
||||
// its own (a payment webhook, a queued job, a staff
|
||||
// action from Filament), so this is the only reliable
|
||||
// source. Falls back to the app default for an order
|
||||
// placed before this existed.
|
||||
if (isset($event->order) && $locale = $event->order->meta['locale'] ?? null) {
|
||||
$notification->locale($locale);
|
||||
}
|
||||
$notification->notifiable()->notify($notification);
|
||||
} catch (Throwable $e) {
|
||||
report($e);
|
||||
|
||||
Reference in New Issue
Block a user