需要短信集成magento

时间:2015-05-20 12:41:27

标签: magento sms integration magento-1.9 sms-gateway

我需要通过短信提供商提供的http sms api集成不同事件的短信,即客户注册,新订单下达,订单状态变更等。如果有人有,请分享。我希望它可以自定义,不想使用任何扩展名。

1 个答案:

答案 0 :(得分:0)

对于短信,您需要购买短信网关。他们提供自己的卷曲类型 api喜欢www.textlocal.com

和api代码一样

$token="some message";
$username = urlencode($email_id);
    $hash = urlencode($secretecode); // Get this when logged in at https://control.txtlocal.co.uk/docs/
    // Message details
    $numbers = urlencode($mobile_no);
    $sender = urlencode('Textlocal');
    $message = rawurlencode('Your activation code is :'.$token);


    $data = 'username=' . $username . '&hash=' . $hash
    . '&numbers=' . $numbers . "&sender=" . $sender . "&message=" . $message;
    // Send the GET request with cURL
    $ch = curl_init('https://api.txtlocal.com/send/?' . $data);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    $response = curl_exec($ch);
    curl_close($ch);  
echo $response;