From 128bdf500abce07b483b57684b8320fec8370d4c Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Mon, 25 Aug 2025 12:02:23 -0700 Subject: [PATCH] sends an email for to locale and cc locale --- app/Http/Controllers/Account/AcceptanceController.php | 6 +++--- app/Listeners/CheckoutableListener.php | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/Account/AcceptanceController.php b/app/Http/Controllers/Account/AcceptanceController.php index 73e26422f6..a029e97df1 100644 --- a/app/Http/Controllers/Account/AcceptanceController.php +++ b/app/Http/Controllers/Account/AcceptanceController.php @@ -248,15 +248,15 @@ class AcceptanceController extends Controller // Add the attachment for the signing user into the $data array $data['file'] = $pdf_filename; - + $locale = $assigned_user->locale; try { - $assigned_user->notify(new AcceptanceAssetAcceptedToUserNotification($data)); + $assigned_user->notify((new AcceptanceAssetAcceptedToUserNotification($data))->locale($locale)); } catch (\Exception $e) { Log::warning($e); } } try { - $acceptance->notify(new AcceptanceAssetAcceptedNotification($data)); + $acceptance->notify((new AcceptanceAssetAcceptedToUserNotification($data))->locale(Setting::getSettings()->locale)); } catch (\Exception $e) { Log::warning($e); } diff --git a/app/Listeners/CheckoutableListener.php b/app/Listeners/CheckoutableListener.php index 7e289b19e6..9674bd63a3 100644 --- a/app/Listeners/CheckoutableListener.php +++ b/app/Listeners/CheckoutableListener.php @@ -96,7 +96,8 @@ class CheckoutableListener if (!empty($to)) { try { - Mail::to(array_flatten($to))->cc(array_flatten($cc))->send($mailable); + Mail::to(array_flatten($to))->send($mailable->locale($notifiable->locale)); + Mail::to(array_flatten($cc))->send($mailable->locale(Setting::getSettings()->locale)); Log::info('Checkout Mail sent to checkout target'); } catch (ClientException $e) { Log::debug("Exception caught during checkout email: " . $e->getMessage()); @@ -180,7 +181,8 @@ class CheckoutableListener try { if (!empty($to)) { - Mail::to(array_flatten($to))->cc(array_flatten($cc))->send($mailable); + Mail::to(array_flatten($to))->send($mailable->locale($notifiable->locale)); + Mail::to(array_flatten($cc))->send($mailable->locale(Setting::getSettings()->locale)); Log::info('Checkin Mail sent to CC addresses'); } } catch (ClientException $e) {