feat: send WhatsApp notification on delivery dispatched
This commit is contained in:
1 parent
a64443110a
commit
8303df358f
2 files changed
+34
No files matched your search
@@ -11,6 +11,7 @@ use App\Models\SalesOrderItem;
|
||||
use App\Models\StockLevel;
|
||||
use App\Models\StockMovement;
|
||||
use App\Models\Warehouse;
|
||||
use App\Notifications\Sales\DeliveryDispatchedNotification;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
@@ -145,6 +146,10 @@ class DeliveryNoteController extends Controller
|
||||
}
|
||||
});
|
||||
|
||||
if ($deliveryNote->customer && $deliveryNote->customer->whatsapp_number) {
|
||||
$deliveryNote->customer->notify(new DeliveryDispatchedNotification($deliveryNote));
|
||||
}
|
||||
|
||||
return redirect()->back()->with('success', 'Delivery note dispatched and stock decremented.');
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user