0

I have purchased normal text bulk sms package from one provider. They don't have module for magento. They are providing only Developer api key for ex:0000-1111-2222-3333 like this. Is there anyway is possible to use that api key to integrate in magento?

0

Yes. It is possible. You need to develop custom module. When some event is occured like order place etc. then you need to call SMS API using given credentials. The module should use observer to listen such event.

Example code: How can i send a sms upon successfull check out in magento?

  • Is it enough to add only that two set of codes which is mentioned in the given link? – Gowri Shankar Aug 4 '17 at 5:19
  • Am totally new to this magento backend. If possible can you explain or share me the link about this from step 1? – Gowri Shankar Aug 4 '17 at 5:20
0

Yes. It is possible. You need to create custom module.

Module file:

<?xml version="1.0"?>
<config>
<modules>
    <Custom_Module>
        <active>true</active>
        <codePool>local</codePool>
    </Custom_Module>
</modules>
</config>

etc/config.xml File:

<config>
<modules>
    <Custom_Module>
        <version>0.1.2</version>
    </Custom_Module>
</modules>
<events>
<checkout_onepage_controller_success_action>
    <observers>
        <send_sms_after_placeorder>
           <class>smsgateway/observer</class>
           <method>sendPlaceOrderSms</method>
       </send_sms_after_placeorder>
    </observers>
</checkout_onepage_controller_success_action>
</events>
</config>

Model/Observer.php

public function sendPlaceOrderSms(Varien_Event_Observer $observer)
{
    $orderIds = $observer->getData('order_ids');
    foreach($orderIds as $_orderId)
    {
        $order = Mage::getModel('sales/order')->load($_orderId);
        $items = $order->getAllItems();
        $order_increment_id = $order->getIncrementId();
        $get_billing_mobile = $order->getBillingAddress()->getTelephone();
        foreach ($items as $cartItem) 
        {
            if($cartItem->getData('product_type')== 'configurable'){
                $product_name = $cartItem->getName();
            }
        }
    }
    $URL = 'your api url';
    $USERNAME = 'api username';
    $PASSWORD = 'api password';
    $USERID = 'api userid';
    $PHONE = $get_billing_mobile;
    $message = "Your Order # $order_increment_id for $product_name.. has been successfully placed. It should be delivered within 3 to 5 days. Thank you for shopping at example.com";
    $TXT = urlencode ($message);
    $Q = "$URL?user=$USERNAME&pass=$PASSWORD&sender=$USERID&phone=$PHONE&text=$TXT&priority=ndnd&stype=normal";
    $res = implode ('', file ($Q));
}
  • I have one doubt. What i need to give in Api url, api username, api password. Sms provider gave only API key. Whether these api url,username and password , I need to create?@Ravi – Gowri Shankar Aug 4 '17 at 7:35
  • Hi, In my case I had been used this API: bhashsms.com You can follow your service provider API document. – Ravi Soni Aug 4 '17 at 7:40
  • For observer, what is the class for this code?@Ravi – Gowri Shankar Sep 12 '17 at 4:13
0

I think SMS marketing is possibly the best way to market. I am using Alcodes as my Bulk SMS provider and I am not facing any problem. Hope it works for you as well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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