How can i send a sms upon successful check out in magento , as i have a third party

sms api integrated already with another project , how can i give all the module as

a library or any other workaround for this in magento ?

  • can you show your sms api code?
    – Amit Bera
    Commented Feb 24, 2015 at 5:26
  • that is not in magento though ? so you want to see how i am sending the sms api url ?
    – KTM
    Commented Feb 24, 2015 at 5:32

2 Answers 2


Icecreamsandwich,you can do this by magento event observer.There are lot of event on order place


  1. checkout_submit_all_after
  2. checkout_onepage_controller_success_action
  3. sales_order_place_after


Observer code:

class MyNameSpace_MyModule_Model_Observer
public function orderSms(Varien_Event_Observer $observer)
    $incrementId = $observer->getEvent()->getOrder()->getIncrementId();
    $custName = $observer->getEvent()->getOrder()->getCustomerFirstname();
    $orderPrice = $observer->getEvent()->getOrder()->getGrandTotal();
    $orderId = $observer->getEvent()->getOrder()->getId();
    $order= $observer->getEvent()->getOrder()
    $mobile =  trim($order->getShippingAddress()->getData('telephone'));
    /* write your Sms code */


You can use any one of this but depends on conditions.

Using sales_order_place_after event;

config.xml code is like:

  • Actually am a newbie in magento , where to put the observer code first ? In app\code\core\Mage\Checkout\Block\Sucess.php ?
    – KTM
    Commented Feb 24, 2015 at 5:57
  • Can you explain this in details pls
    – KTM
    Commented Feb 25, 2015 at 6:10
  • 1
    okay i done it as checkout_onepage_controller_success_action observer it works properly , whether it will work same for the sales_order_place_after observer too ? because i need to send sms only after placing the order .
    – KTM
    Commented Feb 26, 2015 at 8:37
  • Good .. @lcecreamsandwish
    – Amit Bera
    Commented Feb 26, 2015 at 8:42
  • Teja.do know about event observer
    – Amit Bera
    Commented Dec 24, 2015 at 11:21

1) For sending SMS on the successful checkout use following observer event.


in your sms module's config.xml.you need to create a module for this


and in your module's observer.php file

class Yourpacakage_SMS_Model_Observer {
        public function order_success($observer){

            // sms code goes here


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.