You are here

function messaging_mail_messaging in Messaging 6.4

Same name and namespace in other branches
  1. 5 messaging_mail/messaging_mail.module \messaging_mail_messaging()
  2. 6 messaging_mail/messaging_mail.module \messaging_mail_messaging()
  3. 6.2 messaging_mail/messaging_mail.module \messaging_mail_messaging()
  4. 6.3 messaging_mail/messaging_mail.module \messaging_mail_messaging()
  5. 7 messaging_mail/messaging_mail.module \messaging_mail_messaging()

Implementation of hook_messaging()

Currently the only operation supported is 'send methods' that will retrieve and array with information fo the sending methods provided by this module.

Parameters

$op: Type of information to retrieve.

Return value

mixed Depending on $op

File

messaging_mail/messaging_mail.module, line 44
Simple mail using Drupal API. Messaging method plug-in

Code

function messaging_mail_messaging($op, $type = NULL) {
  switch ($op) {
    case 'send methods':
      $info['mail'] = array(
        'title' => 'Drupal mail',
        'name' => t('Mail'),
        // Name for display
        'description' => t('Send e-mails using the default Drupal mail library.'),
        'address_type' => 'mail',
        // Which kind of address this method uses
        'group' => 'mail',
        // Class of sending method
        'type' => MESSAGING_TYPE_SEND,
        // Method type: push || pull
        'glue' => "\n",
        // Glue for message body lines
        'footer' => "\n--",
        // Separator for message footer
        'send callback' => 'messaging_mail_send_msg',
        // Sending callback
        'class' => 'Messaging_Method_Mail',
        'filter' => 'messaging_plaintext',
        // Default filter for this format
        'anonymous' => TRUE,
      );
      return $info;
    case 'address types':

      // Get some built in address types
      $types['mail'] = array(
        'name' => t('E-mail address'),
        // Name for display
        'validate callback' => 'valid_email_address',
        // Validation callback
        'account_property' => 'mail',
        // Property on user account
        'address2uid callback' => 'messaging_address_get_uid',
        'field_name' => 'mail',
        // Field on which this address is stored
        'field_table' => 'users',
      );
      return $types;
  }
}