forked from Nikeev/drupal_sendgrid
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsendgrid.api.php
More file actions
35 lines (32 loc) · 954 Bytes
/
sendgrid.api.php
File metadata and controls
35 lines (32 loc) · 954 Bytes
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
<?php
/**
* @file
* This file contains no working PHP code; it exists to provide additional
* documentation for doxygen as well as to document hooks in the standard
* Drupal manner.
*/
/**
* Allows other modules to alter the allowed attachment file types.
*
* @array $types
* An array of file types indexed numerically.
*/
function hook_sendgrid_valid_attachment_types_alter(&$types) {
// Example, allow word docs:
$types[] = 'application/msword';
// Allow openoffice docs:
$types[] = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
}
/**
* Allow other modules to respond to the result of sending an email.
*
* @param array $result
* Associative array containing the send result, including the status.
*/
function hook_sendgrid_mailsend_result($result) {
if ($result['status'] == 'rejected') {
// Delete user.
$user = user_load_by_mail($result['email']);
$user->uid->delete();
}
}