mandrill.api.php in Mandrill 8
Same filename and directory in other branches
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.
File
mandrill.api.phpView source
<?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_mandrill_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.
* @param array $message
* Associative array containing the message information sent to Mandrill.
*/
function hook_mandrill_mailsend_result($result, $message) {
if ($result['status'] == 'rejected') {
// Delete user.
$user = user_load_by_mail($result['email']);
$user->uid
->delete();
}
}
Functions
Name | Description |
---|---|
hook_mandrill_mailsend_result | Allow other modules to respond to the result of sending an email. |
hook_mandrill_valid_attachment_types_alter | Allows other modules to alter the allowed attachment file types. |