-
Notifications
You must be signed in to change notification settings - Fork 0
/
mailersend.module
46 lines (42 loc) · 1.01 KB
/
mailersend.module
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
<?php
/**
* @file
* Hook implementations for the MailerSend module.
*/
/**
* Implements hook_theme().
*/
function mailersend_theme() {
return [
'mailersend_message' => [
'variables' => [
'module' => NULL,
'key' => NULL,
'subject' => NULL,
'body' => NULL,
'site_name' => NULL,
'langcode' => NULL,
],
],
];
}
/**
* Implements hook_preprocess_HOOK().
*/
function template_preprocess_mailersend_message(array &$variables) {
$variables['module'] = str_replace('_', '-', $variables['module']);
$variables['key'] = str_replace('_', '-', $variables['key']);
}
/**
* Inspired by mimemail module.
*
* Implements hook_theme_suggestions_HOOK().
*
* @see https://git.drupalcode.org/project/mimemail/-/blob/8.x-1.x/mimemail.module
*/
function mimemail_theme_suggestions_mimemail_message(array $variables) {
return [
'mailersend_message__' . $variables['module'],
'mailersend_message__' . $variables['module'] . '__' . $variables['key'],
];
}