You are here

mandrill.api.php in Mandrill 8

Same filename and directory in other branches
  1. 7.2 mandrill.api.php
  2. 7 mandrill.api.php

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.php
View 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

Namesort descending 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.