This repository has been archived by the owner on Feb 9, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmandrill.install
96 lines (82 loc) · 2.17 KB
/
mandrill.install
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
85
86
87
88
89
90
91
92
93
94
95
96
<?php
/**
* @file
* Install, update and uninstall functions for the mandrill module.
*/
/**
* Implements hook_uninstall().
*/
function mandrill_uninstall() {
// Delete other variables:
variable_del('mandrill_analytics_campaign');
variable_del('mandrill_analytics_domains');
variable_del('mandrill_api_key');
variable_del('mandrill_filter_format');
variable_del('mandrill_from');
variable_del('mandrill_from_name');
variable_del('mandrill_mail_key_blacklist');
variable_del('mandrill_test_address');
variable_del('mandrill_test_body');
variable_del('mandrill_track_clicks');
variable_del('mandrill_track_opens');
variable_del('mandrill_url_strip_qs');
variable_del('mandrill_process_async');
}
/**
* Implements hook_enable().
*/
function mandrill_enable() {
mailsystem_set(array('mandrill_test' => 'MandrillMailSystem'));
}
/**
* Implements hook_disable().
*/
function mandrill_disable() {
// Tell mailsystem to remove mandrill and restore to defaults:
mailsystem_clear(array('mandrill_test' => 'MandrillMailSystem'));
watchdog('mandrill', 'Mandrill has been disabled.');
}
/**
* Deletes obsolete variables.
*/
function mandrill_update_7001() {
variable_del('mandrill_status');
}
/**
* Rebuilds the registry, as we've moved some files around.
*/
function mandrill_update_7002() {
// Rebuild the registry, we've moved some files around.
registry_rebuild();
}
/**
* Implements hook_requirements().
*/
function mandrill_requirements($phase) {
$requirements = array();
// Ensure translations don't break at install time.
$t = get_t();
if ($phase == 'update') {
if (!module_exists('mailsystem')) {
$requirements['mandrill'] = array(
'title' => $t('Mandrill'),
'value' => '7.x-1.4',
'description' => $t('Mail System module is required for Mandrill 7.x-1.3 or higher.'),
'severity' => REQUIREMENT_ERROR,
);
}
}
return $requirements;
}
/**
* Delete obsolete batch limit variable.
*/
function mandrill_update_7003() {
variable_del('mandrill_batch_limit');
}
/**
* Clear cache to pick up new class name for DrupalMandrill class.
*/
function mandrill_update_7004() {
cache_clear_all();
}