mandrill.api.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. /**
  3. * @file
  4. * This file contains no working PHP code; it exists to provide additional
  5. * documentation for doxygen as well as to document hooks in the standard
  6. * Drupal manner.
  7. */
  8. /**
  9. * Allows other modules to alter the Mandrill message and sender arguments.
  10. *
  11. * @array $mandrill_params
  12. * The mandril message array
  13. * @see MandrillMailSystem::mail()
  14. *
  15. * @array $message
  16. * The drupal_mail message array.
  17. * @see drupal_mail()
  18. */
  19. function hook_mandrill_mail_alter(&$mandrill_params, $message) {
  20. // No example.
  21. }
  22. /**
  23. * Allows other modules to alter the allowed attachment file types.
  24. *
  25. * @array $types
  26. * An array of file types indexed numerically.
  27. */
  28. function hook_mandrill_valid_attachment_types_alter(&$types) {
  29. // Example, allow word docs:
  30. $types[] = 'application/msword';
  31. // Allow openoffice docs:
  32. $types[] = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
  33. }
  34. /**
  35. * Allow other modules to respond to the result of sending an email.
  36. *
  37. * @param array $result
  38. * Associative array containing the send result, including the status.
  39. */
  40. function hook_mandrill_mailsend_result($result) {
  41. if ($result['status'] == 'rejected') {
  42. // Delete user.
  43. $user = user_load_by_mail($result['email']);
  44. user_delete($user->uid);
  45. }
  46. }