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_install().
29 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_install
31 function flexmailer_civicrm_install() {
32 _flexmailer_civix_civicrm_install();
36 * Implements hook_civicrm_postInstall().
38 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_postInstall
40 function flexmailer_civicrm_postInstall() {
41 _flexmailer_civix_civicrm_postInstall();
45 * Implements hook_civicrm_uninstall().
47 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_uninstall
49 function flexmailer_civicrm_uninstall() {
50 _flexmailer_civix_civicrm_uninstall();
54 * Implements hook_civicrm_enable().
56 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_enable
58 function flexmailer_civicrm_enable() {
59 _flexmailer_civix_civicrm_enable();
63 * Implements hook_civicrm_disable().
65 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_disable
67 function flexmailer_civicrm_disable() {
68 _flexmailer_civix_civicrm_disable();
72 * Implements hook_civicrm_upgrade().
74 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_upgrade
76 function flexmailer_civicrm_upgrade($op, CRM_Queue_Queue
$queue = NULL) {
77 return _flexmailer_civix_civicrm_upgrade($op, $queue);
81 * Implements hook_civicrm_navigationMenu().
83 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_navigationMenu
85 function flexmailer_civicrm_navigationMenu(&$menu) {
86 _flexmailer_civix_insert_navigation_menu($menu, 'Administer/CiviMail', [
87 'label' => E
::ts('Flexmailer Settings'),
88 'name' => 'flexmailer_settings',
89 'permission' => 'administer CiviCRM',
93 'url' => CRM_Utils_System
::url('civicrm/admin/setting/flexmailer', 'reset=1', TRUE),
95 _flexmailer_civix_navigationMenu($menu);
99 * Implements hook_civicrm_container().
101 function flexmailer_civicrm_container($container) {
102 $container->addResource(new \Symfony\Component\Config\
Resource\
FileResource(__FILE__
));
103 \Civi\FlexMailer\Services
::registerServices($container);
107 * Get a list of delivery options for traditional mailings.
110 * Array (string $machineName => string $label).
112 function _flexmailer_traditional_options() {
114 'auto' => E
::ts('Automatic'),
115 'bao' => E
::ts('CiviMail BAO'),
116 'flexmailer' => E
::ts('Flexmailer Pipeline'),