dev/core#2141 - Add hook_civicrm_alterMailStore
[civicrm-core.git] / CRM / Utils / Hook.php
index 06888c960c99568aad0af2a0fd8043b57edb9df2..bc905d21baa3f7d259071d8e8bcf72140d037dba 100644 (file)
@@ -1219,6 +1219,33 @@ abstract class CRM_Utils_Hook {
     );
   }
 
+  /**
+   * This hook is called when loading a mail-store (e.g. IMAP, POP3, or Maildir).
+   *
+   * @param array $params
+   *   Most fields correspond to data in the MailSettings entity:
+   *   - id: int
+   *   - server: string
+   *   - username: string
+   *   - password: string
+   *   - is_ssl: bool
+   *   - source: string
+   *   - local_part: string
+   *
+   *   With a few supplements
+   *   - protocol: string, symbolic protocol name (e.g. "IMAP")
+   *   - factory: callable, the function which instantiates the driver class
+   *   - auth: string, (for some drivers) specify the authentication method (eg "Password" or "XOAuth2")
+   *
+   * @return mixed
+   */
+  public static function alterMailStore(&$params) {
+    return self::singleton()->invoke(['params'], $params, $context,
+      self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject,
+      'civicrm_alterMailStore'
+    );
+  }
+
   /**
    * This hook is called when membership status is being calculated.
    *