SMS Notifier issue – Moodle 3.2

A client of mine uses the SMS Notifier block with Clickatell to send messages to their students.

Recently they ran into a small issue whereby only the first word of the message was being sent to the users phone.

sms_test.jpg

If you debug the message being sent /blocks/sms/lib.php – line 156, you will notice that the full message is being sent to Clickatell.

http://api.clickatell.com/http/sendmsg?user=USERNAMEGat&password=PASSWORD&api_id=1234567&to=+2783xxxxxx&text=’Welcome to all students attending the Basic Moodle course

Since the full message is leaving Moodle well formed, I thought the bug had to be with the delivery. Not so, turns out the issue was still in Moodle. The fix was to catch the message and replace the SPACE with %20.

 

 

 

$msg = str_replace(‘ ‘, ‘%20’, $message); // update by iLite
$url = “http://api.clickatell.com/http/sendmsg?user=”.$username.”&password=”.$password.”&api_id=”.$api_id.”&to=”.$numbers.”&text=”.$msg;

With the fix in place, the messages were once more coming through as expected.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s