steps-to-send-sms-from-odoo-application-to-mobile-number.png
Blogger_636316574414355870.jpg
By: Saritha

Steps to send SMS from Odoo application to mobile number

Short Message Service (SMS) has become a common tool for communication all over the world. It is very simple to send SMS from Odoo to any mobile number in the world using web application programming interface (API). Let's have a look at how it works.

 

Web Application Interface (API)

To send SMS, we need SMS Service provider. There are a lot of websites which provide Sms API Gateway. Some of them are listed below.

1. Twilio

2. Nexmo

3. Msg91

4. Textlocal

5. Sms Horizon

 

How to get API from SMS Service Providers

To get SMS API, First, you need to set up an account on any one of the providers listed above or anyone, which you know. You need to pay a certain amount for sending SMS. The amount varies on providers you suggest. First, select a provider and then take a free trial.


1.Sign up using your mobile number and email address,

2.Message with secret code is sent to your registered mobile number.

3.Login using that secret key.

4.Get SMS Authentication key and URL (This is what we need to send SMS).

 

Integrating Odoo with Sms

1.Create a file named

First, we need to create a .py file where we need to write code for sending SMS. This is the file that we run to send SMS to any mobile number

2.Code for sending SMS

        import urllib

        import urllib2

        authkey =”xxxxxxxxxxxxxxxxxxx”

        mobiles = “xxxxxxxxxxxxxxxxxxxxx”

        message = "Connection Test Succeeded"

        sender = "112233"

        route = "default"

        values = {

                  'authkey': authkey,

                  'mobiles': mobiles,

                  'message': message,

                  'sender': sender,

                  'route': route

                  }

        url = “xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”

        postdata = urllib.urlencode(values)

        req = urllib2.Request(url, postdata)

        response = urllib2.urlopen(req)

        output = response.read()

        print output

        return True

 

3.Authentication key and URL

Paste authentication key, URL, and mobile number to above-described fields. You can also change the content of a message.

 

4.Free Trial

Take a free trail by running above code in Odoo. You can see the message given below on given number.





Comments

0


Leave a comment

 

CONNECT SOCIALLY