engagements.api.php

This file describes hooks provided by the engagements module, which other modules can take advantage of.

File

modules/engagements/engagements.api.php
View source
  1. <?php
  2. /**
  3. @file
  4. This file describes hooks provided by the engagements module, which other modules
  5. can take advantage of.
  6. */
  7. /**
  8. * Called when an SMS is received by FlightPath and before any logic, queries, etc., are performed.
  9. *
  10. * It is safe to assume the SMS has been validated.
  11. *
  12. * Notice that $vars is passed by reference, so changes can be made if desired.
  13. *
  14. * @param unknown $vars
  15. */
  16. function hook_engagements_handle_incoming_sms_init(&$vars) {
  17. // Example code:
  18. $message_sid = $vars['MessageSid'];
  19. if ($message_sid == 'x12-ffg-3445') {
  20. // Perform special DB inserts into custom table.
  21. }
  22. }
  23. /**
  24. * Called at the very end of the engagements_handle_incoming_sms function, after the SMS message has been
  25. * received, and any alerts or other content have been created, and it has been added to the sms_history table.
  26. *
  27. * The $sms_history_mid value is the `mid` from the sms_history database table.
  28. *
  29. * $content_created is an array of content (like the engagement, alerts, etc) which were created as a result
  30. * of this SMS).
  31. */
  32. function hook_engagements_handle_incoming_sms_post_save(&$vars, $sms_history_mid = 0, $content_created = array()) {
  33. // Ex: Query sms_history where mid = $sms_history_mid, insert into other table
  34. }

Functions

Namesort descending Description
hook_engagements_handle_incoming_sms_init Called when an SMS is received by FlightPath and before any logic, queries, etc., are performed.
hook_engagements_handle_incoming_sms_post_save Called at the very end of the engagements_handle_incoming_sms function, after the SMS message has been received, and any alerts or other content have been created, and it has been added to the sms_history table.