-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmailutils.php
84 lines (76 loc) · 2.23 KB
/
mailutils.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
require_once 'mailutils.civix.php';
use CRM_Mailutils_ExtensionUtil as E;
/**
* Implements hook_civicrm_config().
*
* @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_config/
*/
function mailutils_civicrm_config(&$config) {
_mailutils_civix_civicrm_config($config);
if (isset(Civi::$statics[__FUNCTION__])) {
return;
}
Civi::$statics[__FUNCTION__] = 1;
// register replacement hooks and let them run as early as possible
Civi::dispatcher()->addListener(
'hook_civicrm_pre',
'Civi\Mailutils\Listener::pre',
PHP_INT_MAX - 1
);
Civi::dispatcher()->addListener(
'hook_civicrm_emailProcessor',
'Civi\Mailutils\Listener::emailProcessor',
PHP_INT_MAX - 1
);
Civi::dispatcher()->addListener(
'hook_civicrm_emailProcessorContact',
'Civi\Mailutils\Listener::emailProcessorContact',
PHP_INT_MAX - 1
);
Civi::dispatcher()->addListener(
'hook_civicrm_apiWrappers',
'Civi\Mailutils\Listener::apiWrappers',
PHP_INT_MAX - 1
);
}
/**
* Implements hook_civicrm_install().
*
* @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_install
*/
function mailutils_civicrm_install() {
_mailutils_civix_civicrm_install();
}
/**
* Implements hook_civicrm_enable().
*
* @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_enable
*/
function mailutils_civicrm_enable() {
_mailutils_civix_civicrm_enable();
}
function mailutils_civicrm_permission(&$permissions) {
$permissions['access mailutils'] = [
'label' => E::ts('Access Mail Utilities'),
'description' => E::ts('Grants the necessary permissions to access the CiviCRM mailutils extension'),
];
}
function mailutils_civicrm_navigationMenu(&$menu) {
_mailutils_civix_insert_navigation_menu($menu, 'Mailings', array(
'label' => E::ts('Mailutils'),
'name' => 'Mailutils',
'permission' => 'access mailutils',
'operator' => 'OR',
'separator' => 2,
));
_mailutils_civix_insert_navigation_menu($menu, 'Mailings/Mailutils', array(
'label' => E::ts('Templates'),
'name' => 'Mailutils_Templates',
'url' => 'civicrm/mailutils/template',
'permission' => 'access mailutils',
'operator' => 'OR',
'separator' => 0,
));
_mailutils_civix_navigationMenu($menu);
}