ontarget
Active Member
Hi
I have several clients using clickatell sms gateway who provide a number of API's including php
https://archive.clickatell.com/developers/scripts/php-library/
I have a fabrik list which has a list of people attending events which include their mobile numbers.
Does anyone have any experience of selecting / filtering a list of users and phone numbers - converting them to an array that would load in the $clickatell->sendMessage(array()
Would this be the correct method?
http://fabrikar.com/forums/index.php?wiki/common-php-tasks/ See Load an array of rows as objects:
I was thinking of creating a form with
Dropdown = Select event (eventName) database join field
Textarea = Enter message
Button = Send Message
php on form process plugin
Then also somehow call the clickatell php stuff above (thats whereI'm stuck!)
If you can help me a get a solution I will happily post the code up to the Wiki
I have several clients using clickatell sms gateway who provide a number of API's including php
https://archive.clickatell.com/developers/scripts/php-library/
PHP:
use Clickatell\Api\ClickatellHttp;
$clickatell = new ClickatellHttp($username, $password, $apiID);
$response = $clickatell->sendMessage(array(1111111111), "My Message");
foreach ($response as $message) {
echo $message->id;
// Message response fields:
// $message->id
// $message->destination
// $message->error
// $message->errorCode
}
Does anyone have any experience of selecting / filtering a list of users and phone numbers - converting them to an array that would load in the $clickatell->sendMessage(array()
Would this be the correct method?
http://fabrikar.com/forums/index.php?wiki/common-php-tasks/ See Load an array of rows as objects:
I was thinking of creating a form with
Dropdown = Select event (eventName) database join field
Textarea = Enter message
Button = Send Message
php on form process plugin
PHP:
/ Get a db connection.
$myDb= JFactory::getDbo();
// Create a new query object.
$myQuery=$myDb->getQuery(true);
$myQuery
->select(array('telephone'))
->from('myEventsTable')
->where('eventName = '.$myDb->quote('value selected in dropdown'));
// Assign the query to the db
$myDb->setQuery($myQuery);
// Load the results as an array of objects.
$rows=$myDb->loadObjectList();
Then also somehow call the clickatell php stuff above (thats whereI'm stuck!)
If you can help me a get a solution I will happily post the code up to the Wiki