1

I have an sms provider in my country, he gave me api url

https://globesms.net/smshub/api.php?username=xxxx&password=xxxx&action=sendsms&from=xxxx&to=xxxx&text=xxxx

How can I call his API when someone place in order and send sms to clients? Can I make use of the integration page or do I have to edit php files?

1

1 Answer 1

0

I'm not sure what you mean with "integration page" - you could use the template of the checkout success page, but I'd rather say "abuse" because such logic does not belong in templates.

Magento has an event system where you can create observers that are executed on certain events. For placed orders there is the event sales_order_place_after and it receives the order model as "order" parameter. If the customers have to enter their phone number, you can access it through this model:

$order = $observer->getData('order');
$phoneNumber = $order->getCustomer()->getTelephone();

Read more on how to create observers in the devdocs: Events and Observers

2
  • not really looking to create a new module since im not good at it,, I just want to know which files have the post variable for number and then use the number variable to send an sms using curl, possible? without the fuss of creating a module
    – Lynob
    Commented Jun 21, 2016 at 8:21
  • I won't give you any advise to edit core files, it will only get you in trouble. Creating a module is really not that hard and it's well documented. Go try it! Commented Jun 21, 2016 at 8:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.