How to contact site users via SMS in the Joomla!
After reading about the benefits of using SMS functionality in
Joomla! SMS you can gain technical information
on how to contact the users of your site via SMS. You can read about the way to
adopt SMS solution on your website with the help of Ozeki NG SMS Gateway. A
configuration guide will help you to download and install the files needed to apply
the "SMS contact with Joomla site users" (available on this page) to be able to
keep in touch with your website users via SMS. After you have installed and
configured this component, visitors will be able to give their phone numbers (e.g. on the
registration form). Learn more about this SMS solution on this page which also
provides a requirements list as well as step by step setup instructions with
video tutorials.
Download:
com_smscontact component file (6KB)
Prerequisites
You can achieve this solution by connecting your system to the mobile
network. To do this, use an Internet connection or you setup a wireless
connection by attaching a GSM phone/GSM modem to your PC. Select the suitable
way by reading the webpage we have prepared for you:
Internet based SMS connections vs. GSM modem based (wireless) SMS connections.
Depending
on what you select, you need the following prerequisites.
Prerequisites for Internet based connection to the
Mobile network
If you decided to connect your system to an SMS service
provider over the Internet you need the following components:

Figure 1/a - Prerequisites for Ozeki NG SMS
Gateway IP SMS connection
In this case you need to find an SMS service provider who has
access to the mobile phones in your area. The SMS service of the SMS
service provider should be able to put you through the Internet. To
select your provider, check our website where we list some of them:
SMPP SMS Service providers.
Once you have found such a provider, sign up for their service to
get the connection parameters. These parameters are needed to
configure your Ozeki NG SMS Gateway software.
Prerequisites for wireless (GSM modem) connection to the Mobile network
If you wish to connect your system to a wireless mobile
network, you need a GSM modem or GSM phone, that can be attached to your
computer with a data cable. This way your Ozeki NG SMS Gateway software
is enabled to operate this phone and can send and receive SMS messages
wirelessly. To setup this connection method, purchase the following
components:
Figure 1/b - Prerequisites for Ozeki NG SMS
Gateway GSM modem connection
Your checklist (for GSM modem connection):
*The SIM card will come with a plan, that will
determine how much money you will spend on each SMS.
System architecture
How to configure SMS Contact in Joomla
To keep contact with the users of your Joomla website, you need to let them provide their
phone numbers at the registration form or at the edit form of their own settings.
The forms should contain a section where they can give their phone numbers.
The phone number will be stored at the database. This way the Administrator
will be able to keep contact with them by sending messages with the help of
Ozeki NG SMS Gateway (see Figure 2).
Figure 2 - How the Administrator sends SMS to registered users
Note:The Administrator can only send SMS to those users
who not only register but give their phone numbers as well.
Configuration of this solution
To be able to send SMS to your contacts from Joomla with SMS
Contact component, follow the installation steps in this guide and watch
the video tutorial for further help.
Installation Steps
Joomla is a CMS (Content Management System) web designer used
for creating and operating websites. With Joomla you can install and use components
which help you in creating contact with users of your Joomla website. You
are able to keep in touch with users with the help of SMS Contact component. SMS
Contact is a great help in informing or helping your contacts via SMS.
You can configure the SMS Contact module in Joomla! with the help
of Ozeki NG SMS Gateway. Follow the installation steps shown in this section.
You are supposed to have installed both Ozeki NG SMS Gateway (you can find the
installer on this page) and Joomla (it is not necessary to have both installed
on the same computer). To install the component, you need to log into the
back-end of Joomla as Administrator. You are enabled to manage or edit your
Joomla website from the back-end. Give the Administrator user name and password
and click on the "Login" button as the example shows in Figure 3.
Figure 3 Log in to Joomla back-end
After logging in, enter the Install/Uninstall page in Extensions
menu, then browse and install the
com_smscontact component file (Figure 4).
Figure 4 - Install com_smscontact file
This way Joomla adopts the Contact site user via Joomla! component.
To be able to provide the phone number section start Windows
Explorer and open the user.php through joomla\libraries\joomla\database\table
path (Figure 5).
Figure 5 - The user.php in table folder
You need to insert an optional field, "phone" in the user.php.
To do so, find the first function in the JTableUSer class in this php file and declare a variable before
as shown in Figure 6.
Figure 6 - Insert phone variable
Variable
for the user.php
var $phone = null;
|
Afer inserting the variable save an close the user.php file.
The next step is to edit the from.php file through the
joomla\administrator\components\com_users\views\tmpl path (Figure 7).
Figure 7 - Enter the form.php in tmpl folder
After opening the file, find line 132 as shown in Figure 8.
Figure 8 - Line 132
Insert an additional table row as shown in Figure 9. Use the table row definition under the
picture.
Figure 9
Table row definition
for form.php
<tr>
<td width="150" class="key">
<label for="phone">
<?php echo JText::_( 'Phone' ); ?>
</label>
</td>
<td>
<input type="text" name="phone" id="phone"
class="inputbox" size="40" value="<?php echo $this->user->
get('phone'); ?>" />
</td>
|
When you inserted the table row definition save and close the form.php file.
Return to your Joomla website and enter the User Manager menu
(Figure 10)
Figure 10 - Joomla! User Manager
You can check the results of editing the two .php files. At the
user properties section you can find the additional phone field. Now you can edit
the users' phone number from the back-end as shown in Figure 11.
Figure 11 - Edit phone number in User Manager
Entering Contact site user via SMS component, the user and the related
phone number is appeared in the list as a potential recipient.
Figure 12 - Administrator's phone number in Contact site user via SMS menu
To enable users to add their own phone numbers on the registration
form other files have to be edited. This time edit default.php file through
the joomla\components\com_users\views\register\tmpl path.
Figure 13 - Enter default.php file
After opening to the file, find line 73 as shown in Figure 14.
Figure 14 - Find line 73 in default.php
Insert a table row definition under line 73 as shown in Figure 15. You can
find this table row definition under Figure 15.
Figure 15 - Table row definition under line 73
Table row definition for
default.php
<tr>
<td height="40">
<label id="phonemsg" for="phone">
<?php echo JText::_( 'Phone' ); ?>:
</label>
</td>
<td>
<input type="text" name="phone" id="phone" size="40"
value="<?php echo $this-> escape($this->user->get( 'phone' ));?>"
class="inputbox" maxlength="50" /> *
</td>
</tr>
|
As a result, the visitors of your website are enabled to give
their phone numbers during the registration. In the example I register a test user as
you can see in Figure 16. I give a phone number as well.
Figure 16 - Registering user with phone number
After registration, the registered users will
appear in the SMS Contact menu.
The next step is to enable the users to change their phone numbers.
Enter joomla\templates\[Template_Name]\html and create com_user folder as
shown in Figure 17.
Figure 17 - Create com_user folder
Enter com_user folder and create a register folder in it
(Figure 18).
Figure 18 - Create register folder
Copy and paste the components\com_user\views\register\tmpl folder's
content here as shown in Figure 19 and 20.
Figure 19 - Copy the content from tmpl folder
Figure 20 - Paste the content to register folder
Create a new user folder in com_user folder
(Figure 21).
Figure 21 - Create user folder
Copy the content from components\com_user\views\user\tmpl folder
as shown in Figure 22.
Figure 22 - Copy the content of tmpl folder
Paste the tmpl folder content in user folder (Figure 23).
Figure 23 - Paste the content in user folder
Open the form.php file for editing. Find line 70 in the file
as shown in Figure 24.
Figure 24 - Line 70 in form.php file
Insert the table row definition you can find under Figure 25 after line 70.
Figure 25 - Table row definition after line 70
Table row definition
for form.php file in user folder
<tr>
<td width="120">
<label for="phone">
<?php echo JText::_( 'Phone' ); ?>:
</label>
</td>
<td>
<input class="inputbox" type="text" id="
phone" name="phone" value="<?php echo $this->
escape($this->user->get('phone'));?>" size="40" />
</td>
</tr>
|
These configuration steps enable the users to edit their phone numbers in the
Edit Your Details form (Figure 26)
Figure 26 - Edit phone number
The configuration came to an end, so the SMS Contact component gained
full functionality. To test it, you can send a test SMS to your users. First, open
the SMS Contact component and select the users you want to send a message for.
Type your message into the Message box as shown in Figure 27 and click on the
"Send" button.
Figure 27 - Test message to contacts
After sending the message you can check if it is delivered in
Ozeki NG SMS Gateway (Figure 28)
Figure 28 - Sent contact messages in Ozeki NG SMS Gateway.
The configuration demonstrated in this section enables you to
provide SMS Contact solution without changing core files. With this solution
you become able to keep in touch with your users and inform them about important
events, news immediately. It also helps you maintain your a list of your contacts
and attain your business plans.
Related pages:
Further readings:
|