• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Receive cellphone SMS when a form is submitted

Receive cellphone SMS when a form is submitted 13 years 7 months ago #11461

  • marioliveira
  • marioliveira's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 6
  • Thank you received: 1
I handle a website where RSFormPro is used to receive online bookings, and I thought it would be great to receive an SMS message on the cellphone whenever a form was submitted. After a little search completed with RSFormPro technical team advice I have it working. Here is waht I did and eant to share with people here who might be interested on doing the same.

To have SMS messages sent, there is the need to have a Clickatell account, that provides gateway services to send SMS messages to a lot of countries - visit www.clickatell.com). Follow the steps below:

Step 1 - Register for a Clickatell account

If you do not already have a Clickatell account, you need to register for one. Otherwise proceed to Step 2.
- Go to www.clickatell.com/products/sms_gateway.php, and choose the appropriate API subproduct (connection method) you wish to use (Clickatell Central - API)
- Click on the registration link.
- Fill out the registration form.

After successfully submitting the form you will automatically be logged into your new account and taken to a page where you can add your chosen API connection.


Step 2 - Add/create a registered API connection (sub-product)

If you are not already logged into your account, then you must do so at www.clickatell.com/login.php
- Select \"Manage my Products\" from the top menu.
- Select the API connection type you wish to use (HTTP API) from the drop down menu ('Add Connection' )
- Complete the form. You may enter the locked IP(the IP of your server), this making shure messages will only be accepted if originary from your server's IP address: set Callback to HTTP POST. And you need to set the IP callback to your website address, like www.yoursite.com/. The result of messages sent, successful or not is sent to this address.

Theoretically there would be a display there, of the message sending result. In practice this way it does not work, i.e. no message is displayed anywhere, which is exactly what I wanted; there is no interruption of the website flow.

If you register more than one API connection, the description name you enter for each must be unique - you cannot have multiple APIs with the same name.

After successfully submitting the form, your authentication details will be displayed, including each connection's unique API ID (api_id). These authentication details are required when connecting to the Clickatell gateway to send a message.


Step 3 - Insert a script on your form

Go to the RSFormPro and select your form(s), and insert under 'Scripts -> script called on form process, the following script:


$user = "xxxxxxxxxxxx";
$password = "xxxxxxxxx";
$api_id = "xxxxxx";
$baseurl ="api.clickatell.com";
$text = urlencode("Text of your message here" );
$to = "123123456789";
// auth call
$url = "$baseurl/http/auth?user=$user&password=$password&api_id=$api_id";
// do auth call
$ret = file($url);
// split our response. return string is on first line of the data returned
$sess = split(":",$ret[0]);
if ($sess[0] == "OK" ) {
$sess_id = trim($sess[1]); // remove any whitespace
$url = "$baseurl/http/sendmsg?session_id=$sess_id&to=$to&text=$text";
// do sendmsg call
$ret = file($url);
$send = split(":",$ret[0]);
if ($send[0] == "ID" )
echo "success
message ID: ". $send[1];
else
echo "send message failed";
} else {
echo "Authentication failure: ". $ret[0];
exit();
}


where user is your clickatell username, followed by your clickatell password and the api_id you defined on step 2. The numbers after $to, are the cellphone numbers to where the SMS has to be sent, where the first digits are the country code followed by the phone number. If there is more than one destination, separate them by commas ("123123456789,123345678123,etc)".

As i mentioned before, the part of the script echoing the sending results (echo, etc) is not shown anywhere (at least using this method), so I didn't bother to find out a way of eliminating those lines.

As text, write anything you would like to be displayed on the SMS message. If you would like to include fields from the form, concatenate them in the message text like this:


$text = urlencode("Message text informing what was filled in at ".${Fieldname_1:value}." as well as ".${Fieldname_2:value}."so anything goes here." );


And that's it! Whenever the form is submitted, you will see the thank you message if you have defined it or whatever sequence you set up, and at the same time a message will be delivered to your cellphone. Easy and chep, Clickatell works on the base of credits, i.e. you book and pay an amount and it will be converted into credits. Then each message is worth a number of credits, 1, 1.5, 2, etc (according to the destination and operator, I think). The minimum value equals 400 credits. Further information about this can be obtained at www.clickatell.com/downloads/http/Clickatell_HTTP.pdf


Enjoy!
Last Edit: 13 years 7 months ago by marioliveira.
The administrator has disabled public write access.
The following user(s) said Thank You: info56443

Receive cellphone SMS when a form is submitted 11 years 1 month ago #21896

Hi.

Doesn't work, any modifications since last post?



Regards

Lars
The administrator has disabled public write access.

Receive cellphone SMS when a form is submitted 9 years 3 months ago #30016

  • dispatch
  • dispatch's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 16
  • Thank you received: 1
I am also wondering if there has been success.

Not only would I like to receive an alert, I would also like to create a form for outbound messages. Not bulk or spam, but manually entering one at a time and send.

This is one of the reasons I purchased RS Form Pro.

Has anyone been successful please?

thanks...Jim
Last Edit: 9 years 3 months ago by dispatch.
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!