CRM-20238 - Create hook for inbound SMS
[civicrm-core.git] / CRM / Utils / Hook.php
index 602028a3788e7425d9e565e89e1fd38241d0e078..e6e130f6a88c155926c6f705a3223a14ed1c467e 100644 (file)
@@ -2299,4 +2299,27 @@ abstract class CRM_Utils_Hook {
     );
   }
 
+  /**
+   * This hook is called before an inbound SMS is processed.
+   *
+   * @param string $from
+   *   The phone number the message is from, as set by SMS provider
+   * @param int $fromContactID
+   *   Set to override default matching
+   * @param string $to
+   *   The optional phone number the message is to, as set by SMS provider
+   * @param int $toContactID
+   *   Set to override default matching
+   * @param string $body
+   *   The body text of the message
+   * @param string $trackID
+   *   The tracking ID of the message
+   *
+   * @return mixed
+   */
+  public static function inboundSMS(&$from, &$fromContactID = NULL, &$to, &$toContactID = NULL, &$body, &$trackID) {
+    return self::singleton()
+      ->invoke(6, $from, $fromContactID, $to, $toContactID, $body, $trackID, 'civicrm_inboundSMS');
+  }
+
 }