Project

General

Profile

Feature #7225

Plugin: Announcements sendable by SMS

Added by Yannick Warnier about 5 years ago. Updated about 5 years ago.

Status:
Feature implemented
Priority:
Normal
Assignee:
Category:
Plugins
Target version:
Start date:
07/08/2014
Due date:
26/08/2014
% Done:

100%

Estimated time:
40.00 h
Spent time:
Complexity:
Normal
SCRUM pts - complexity:
?

Description

There is no way to find an open-source software to do this, as this requires access to a mobile phone infrastructure. However, there are systems around which make it very easy to register an account, get an API key and send a few SMS.

I believe a small plugin could enable this by plugging into the courses announcements system (would require hacks to the announcements mail-sending process, but no change to the database).

There is a REST interface for Clockwork explained here: http://www.clockworksms.com/doc/easy-stuff/http-interface/send-sms/ and the cost of each SMS is ~0.06€/SMS (it is still expensive, but it works to send them all around the world). You can send it to up to 50 numbers at a time, with a single REST call, which makes it practical for most courses.

The process to register an account with Clockwork is simply to register here: http://www.clockworksms.com/platforms/piwik/ (in the case of Piwik), register, confirm your mail, get an API key and register this API key in the Chamilo plugin's config page and... that's it... We could then add a "mobile phone" user field at the plugin's install time (or ask for the name of the corresponding extra field in the plugin configuration).

Ideally, the plugin would also send an e-mail to the teacher with the results of the message sending for each user, so the teacher knows if some people did not receive it, for example.

Finally, to avoid overcosts, the plugin should offer a list of checkboxes with each message type, and only send an SMS in these cases where the checkbox has been selected.

A landing page will be setup by Clockworks for us at http://www.clockworksms.com/platforms/chamilo/ This is where the plugin should send you to get an API key.


Files


Related issues

Related to Personal Messenger - Feature #5856: SMSNew30/12/2012

Actions

Associated revisions

Revision bea2ed02 (diff)
Added by Imanol Losada about 5 years ago

Create Clockworksms plugin; Implement in several mail sending calls - refs #7225

Revision dff15370 (diff)
Added by Yannick Warnier about 5 years ago

Remove useless files in clockworks plugin - refs #7225

Revision 488afcac (diff)
Added by Imanol Losada about 5 years ago

Change directory structure and follow code convention - refs #7225

History

#1

Updated by Yannick Warnier about 5 years ago

  • Status changed from New to Assigned
  • Assignee set to Angel Quiroz
#2

Updated by Yannick Warnier about 5 years ago

  • Description updated (diff)
  • Due date set to 26/08/2014
  • Estimated time set to 40.00 h
#3

Updated by Yannick Warnier about 5 years ago

  • Description updated (diff)
#4

Updated by Imanol Losada about 5 years ago

  • Assignee changed from Angel Quiroz to Imanol Losada
#5

Updated by Yannick Warnier about 5 years ago

Attaching modified list of e-mails sent by the platform. Lines marked in grey should be ignored (not included in the options offered to admins) although they should have a message type assigned.

#7

Updated by Yannick Warnier about 5 years ago

  • Status changed from Assigned to Needs testing
  • Assignee deleted (Imanol Losada)

Merge done.
Needs review.

#8

Updated by Julio Montoya about 5 years ago

This plugin introduces a lot of fatal errors and does not respect coding standards see task:

https://task.beeznest.com/issues/8717

Yannick, I think I'm going to remove your merge permissions :)

https://github.com/chamilo/chamilo-lms/commit/79b7d90130152be65b30bf98161afb39086a303a

#9

Updated by Yannick Warnier about 5 years ago

In your fix, I cannot see anything that would lead to a fatal error if the plugin is disabled... and the plugin is still in "needs testing" :-)

#10

Updated by Yannick Warnier about 5 years ago

Ok, found it in your comment in the private task:

Fatal error: Can't use function return value in write context in www/plugin/clockworksms/lib/clockworksms.lib.php on line 37

This is one of those pesky PHP errors that don't show in all contexts.
empty() is not a function but a language construct (not sure), and it only takes variables, so it doesn't work on the return value of a function.

http://php.net/empty:

    Note:
    Prior to PHP 5.5, empty() only supports variables; anything else will result in a parse error. In other words, the following will not work: empty(trim($name)). Instead, use trim($name) == false.

This explains why it worked on Imanol's server but not on Noa's (still in 5.4)

#12

Updated by Imanol Losada about 5 years ago

Two commits:
* Tabspaces replaced with whitespaces
* Code style fixed following Yannick's corrections

PR: https://github.com/chamilo/chamilo-lms/pull/371

These two PRs apply your corrections. First of them is for chamilo files only. The other one is for plugin part only.
PR: https://github.com/chamilo/chamilo-lms/pull/372
PR: https://github.com/chamilo/chamilo-lms/pull/373

#13

Updated by Imanol Losada about 5 years ago

  • Assignee set to Yannick Warnier
#14

Updated by Yannick Warnier about 5 years ago

  • Status changed from Needs testing to Feature implemented
  • Assignee changed from Yannick Warnier to Imanol Losada
  • % Done changed from 0 to 100

PRs checked and applied. There is an issue still with the PR related to the mobile phone number field, but this is something else. Closing this one.

This one was good for the learning process :-)

#15

Updated by Yannick Warnier about 5 years ago

Imanol, please update the time spent on this one. I believe it is more than 40h :-)

#16

Updated by Yannick Warnier about 5 years ago

There's a license issue with this plugin, as explained in https://github.com/mediaburst/clockwork-php/issues/3
We are pending an answer from Mediaburst to know if we might include it.

Also available in: Atom PDF