SMS Notification

Laraship QuestionsCategory: TechnicalSMS Notification
Abdal Asif asked 5 years ago
Hi Laraship,   I am trying to integrate a third party API for SMS. which I want to execute when the order is dispatched and received. As per your documentation i can make a hook and define it inEcommerceServiceProvider::registerHooks() but i can't find out the action available for before and after order.what should i mention in the action.   \Actions::add_action('?', [Ecommerce::class, 'send_sms'], 12);
1 Answers
Best Answer
laraship Staff answered 5 years ago

Hello,

The hook needs to be injected in your module, its not recommended to override the ecommerce pages, so in your modules custom provider you can add the hook registration.

the hook name post_product_order_received and you will receieve the $order variable

        \Actions::add_action('post_product_order_received', [YourHooksClass::class, 'send_sms'], 12);

so the function will be inside YourHooksClass.php

public function send_sms($order)

{

\\ Your custom code

}