messaging_mime_mail.module

Tracking 6.x-4.x branch
  1. drupal
    1. 6 contributions/messaging/messaging_mime_mail/messaging_mime_mail.module

Mime mail using Drupal API. Messaging method plug-in

Functions & methods

NameDescription
messaging_mime_mail_disableImplementation of hook_disable()
messaging_mime_mail_messagingImplementation of hook_messaging
messaging_mime_mail_send_msgSend mime mail message to user account

File

View source
  1. <?php
  2. /**
  3. * @file
  4. * Mime mail using Drupal API. Messaging method plug-in
  5. */
  6. /**
  7. * Implementation of hook_messaging
  8. */
  9. function messaging_mime_mail_messaging($op = 'info') {
  10. switch($op) {
  11. case 'send methods':
  12. $info['mimemail'] = array(
  13. 'title' => 'Mime Mail',
  14. 'name' => t('Mime Mail'), // Name for display
  15. 'description' => t('Send e-mails using Mime Mail module.'),
  16. 'address_type' => 'mail', // Type of address
  17. 'group' => 'mail', // Class of send method
  18. 'glue' => "<br>", // don't use <br/> nor <br /> for maximum HTML email client compatibility
  19. 'footer' => "-- \n", // Separator for message footer
  20. 'send callback' => 'messaging_mime_mail_send_msg', // Sending callback
  21. 'class' => 'Messaging_Method_Mail',
  22. 'filter' => 'messaging_html', // Default filter for this format
  23. 'anonymous' => TRUE, // This method supports anonymous destinations
  24. );
  25. return $info;
  26. }
  27. }
  28. /**
  29. * Send mime mail message to user account
  30. *
  31. * @param $destination
  32. * Destination email address
  33. * @param $message
  34. * Message array
  35. */
  36. function messaging_mime_mail_send_msg($destination, $message, $params) {
  37. // mimemail($sender, $recipient, $subject, $body, $plaintext = NULL, $headers = array(), $text = NULL, $attachments = array(), $mailkey = '')
  38. return mimemail($params['from'], $destination, $message->get_subject(), $message->get_body(), NULL, $params['headers'], NULL, $message->get_files(), $params['id']);
  39. }
  40. /**
  41. * Implementation of hook_disable()
  42. */
  43. function messaging_mime_mail_disable() {
  44. messaging_method_disable('mimemail');
  45. }