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.

Leave a Reply

Your email address will not be published. Required fields are marked *