<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Amaroks</title>
	<atom:link href="http://amaroks.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://amaroks.com</link>
	<description>House of Mody Said</description>
	<lastBuildDate>Sun, 01 Jan 2012 12:54:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Clickatell php Class</title>
		<link>http://amaroks.com/clickatell-php-class/</link>
		<comments>http://amaroks.com/clickatell-php-class/#comments</comments>
		<pubDate>Sun, 01 Jan 2012 01:24:30 +0000</pubDate>
		<dc:creator>mody</dc:creator>
				<category><![CDATA[php classes]]></category>

		<guid isPermaLink="false">http://amaroks.com/?p=604</guid>
		<description><![CDATA[I have been building a facebook sms app and needed to use Clickatell gateway to send sms using their http api, I have used their sample php script in the past, but for this app I&#8217;m using CodeIgniter a powerfull php object oriented framework and need to keep my code clean so I had to [...]]]></description>
			<content:encoded><![CDATA[<p>I have been building a facebook sms app and needed to use Clickatell gateway to send sms using their http api, I have used  their sample php <a href="http://www.clickatell.com/developers/php.php">script</a> in the past, but for this app I&#8217;m using <a href="http://codeigniter.com" title="Opens in new window" target="_blank">CodeIgniter</a> a powerfull php object oriented framework and need to keep my code clean so I had to use Clickatell http API in a better way so I wrote this simple <a href="https://bitbucket.org/amaroks/clickatell_php/src" target="_blank">sms class</a> (<a href="https://bitbucket.org/amaroks/clickatell_php/src" target="_blank">Download</a> from Bitbucket).</p>
<p><strong>Basic Usage:</strong></p>
<pre>
require_once 'clickatell.php';

# initialize class
$sms = new Clickatell();

# Prepare and send
$sms->to  = "002154584";
$sms->msg = "This is a text";
$sms->send();
</pre>
<p>in the example above I assume that you have added your clickatell username, password and api_id in the class file<br />
if not then you would do something <strong>like this</strong>:</p>
<pre>
require_once 'clickatell.php';

# initialize class
$sms = new Clickatell();

# set clickatell credentials
$sms->username = "myuser";
$sms->password = "mypass";
$sms->api_id   = "myapiid";

# Prepare and send
$sms->to  = "002154584";
$sms->msg = "This is a text";
$sms->send();
</pre>
<p>The class Send function will either return a message ID (if send succeed) or return false if failed.<br />
if you are developing and want to debug <strong>then simply add this</strong> before using $sms->Send()</p>
<pre>
$sms->debug = true;
</pre>
<p>then the Send function will either return a message ID on success or return something like this:</p>
<p class="note">
Type: Error<br />
Error Code: 135<br />
Error Message: Authentication Failed
</p>
<p>You can download Clickatell PHP Class from bitbucket<br />
<a href="https://bitbucket.org/amaroks/clickatell_php/src" target="_blank">https://bitbucket.org/amaroks/clickatell_php/src</a></p>
<p>You can see the Facebook sms app I built here:<br />
<a href="http://apps.facebook.com/sms_world/" target="_blank">http://apps.facebook.com/sms_world/</a></p>
<p>Let me know if you have any questions!</p>
]]></content:encoded>
			<wfw:commentRss>http://amaroks.com/clickatell-php-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

