disable notification for non production enviroments

This commit is contained in:
Omair Saleh
2022-11-10 21:11:45 +08:00
parent 58e9e80fd9
commit 22b03669c6
3 changed files with 9 additions and 3 deletions
@@ -410,7 +410,9 @@ class FetchOrderListsFromYdPortalProcessor
foreach ($container->packingLists as $packingList){
if(!($packingList->owner instanceof Order)) continue;
$user = $packingList->owner->companyModule->employees()->first();
$user->notify(new ShipmentRescheduleEmail($user, $packingList));
if(App()->enviroment() === 'production') {
$user->notify(new ShipmentRescheduleEmail($user, $packingList));
}
}
}
@@ -89,7 +89,9 @@ class ApproveShippingInvoiceTransactionLogic extends AbstractControllerLogic
$this->createsFiles->execute($document, $document_object);
$user = $packing_list->owner->companyModule->employees()->first();
$user->notify(new InvoiceIssuedEmail($user, $packing_list));
if(App()->enviroment() === 'production') {
$user->notify(new InvoiceIssuedEmail($user, $packing_list));
}
return $this->response([]);
}
@@ -53,7 +53,9 @@ class SendContainerDepartureEmailCommand extends Command
foreach ($container->packingLists as $packingList){
if(!($packingList->owner instanceof Order)) continue;
$user = $packingList->owner->companyModule->employees()->first();
$user->notify(new ShipmentDepartureEmail($user, $packingList));
if(App()->enviroment() === 'production') {
$user->notify(new ShipmentDepartureEmail($user, $packingList));
}
}
}