4 * Civi v5.19 does not provide all the API's we would need to define
5 * FlexMailer in an extension, but you can patch core to simulate them.
6 * These define()s tell core to enable any such hacks (if available).
9 define('CIVICRM_FLEXMAILER_HACK_DELIVER', '\Civi\FlexMailer\FlexMailer::createAndRun');
10 define('CIVICRM_FLEXMAILER_HACK_SENDABLE', '\Civi\FlexMailer\Validator::createAndRun');
11 define('CIVICRM_FLEXMAILER_HACK_REQUIRED_TOKENS', 'call://civi_flexmailer_required_tokens/getRequiredTokens');
13 require_once 'flexmailer.civix.php';
15 use CRM_Flexmailer_ExtensionUtil
as E
;
18 * Implements hook_civicrm_config().
20 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_config
22 function flexmailer_civicrm_config(&$config) {
23 _flexmailer_civix_civicrm_config($config);
27 * Implements hook_civicrm_xmlMenu().
29 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_xmlMenu
31 function flexmailer_civicrm_xmlMenu(&$files) {
32 _flexmailer_civix_civicrm_xmlMenu($files);
36 * Implements hook_civicrm_install().
38 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_install
40 function flexmailer_civicrm_install() {
41 _flexmailer_civix_civicrm_install();
45 * Implements hook_civicrm_postInstall().
47 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_postInstall
49 function flexmailer_civicrm_postInstall() {
50 _flexmailer_civix_civicrm_postInstall();
54 * Implements hook_civicrm_uninstall().
56 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_uninstall
58 function flexmailer_civicrm_uninstall() {
59 _flexmailer_civix_civicrm_uninstall();
63 * Implements hook_civicrm_enable().
65 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_enable
67 function flexmailer_civicrm_enable() {
68 _flexmailer_civix_civicrm_enable();
72 * Implements hook_civicrm_disable().
74 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_disable
76 function flexmailer_civicrm_disable() {
77 _flexmailer_civix_civicrm_disable();
81 * Implements hook_civicrm_upgrade().
83 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_upgrade
85 function flexmailer_civicrm_upgrade($op, CRM_Queue_Queue
$queue = NULL) {
86 return _flexmailer_civix_civicrm_upgrade($op, $queue);
90 * Implements hook_civicrm_managed().
92 * Generate a list of entities to create/deactivate/delete when this module
93 * is installed, disabled, uninstalled.
95 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_managed
97 function flexmailer_civicrm_managed(&$entities) {
98 _flexmailer_civix_civicrm_managed($entities);
102 * Implements hook_civicrm_angularModules().
104 * Generate a list of Angular modules.
106 * Note: This hook only runs in CiviCRM 4.5+. It may
107 * use features only available in v4.6+.
109 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_caseTypes
111 function flexmailer_civicrm_angularModules(&$angularModules) {
112 _flexmailer_civix_civicrm_angularModules($angularModules);
116 * Implements hook_civicrm_alterSettingsFolders().
118 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_alterSettingsFolders
120 function flexmailer_civicrm_alterSettingsFolders(&$metaDataFolders = NULL) {
121 _flexmailer_civix_civicrm_alterSettingsFolders($metaDataFolders);
125 * Implements hook_civicrm_navigationMenu().
127 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_navigationMenu
129 function flexmailer_civicrm_navigationMenu(&$menu) {
130 _flexmailer_civix_insert_navigation_menu($menu, 'Administer/CiviMail', [
131 'label' => E
::ts('Flexmailer Settings'),
132 'name' => 'flexmailer_settings',
133 'permission' => 'administer CiviCRM',
137 'url' => CRM_Utils_System
::url('civicrm/admin/setting/flexmailer', 'reset=1', TRUE),
139 _flexmailer_civix_navigationMenu($menu);
143 * Implements hook_civicrm_container().
145 function flexmailer_civicrm_container($container) {
146 $container->addResource(new \Symfony\Component\Config\
Resource\
FileResource(__FILE__
));
147 \Civi\FlexMailer\Services
::registerServices($container);
151 * Get a list of delivery options for traditional mailings.
154 * Array (string $machineName => string $label).
156 function _flexmailer_traditional_options() {
158 'auto' => E
::ts('Automatic'),
159 'bao' => E
::ts('CiviMail BAO'),
160 'flexmailer' => E
::ts('Flexmailer Pipeline'),