You are here

function mimemail_rules_action_info in Mime Mail 7

Same name and namespace in other branches
  1. 6 includes/mimemail.rules.inc \mimemail_rules_action_info()

Implements hook_rules_action_info().

File

./mimemail.rules.inc, line 14
Rules actions for sending Mime-encoded emails.

Code

function mimemail_rules_action_info() {
  return array(
    'mimemail' => array(
      'label' => t('Send HTML e-mail'),
      'group' => t('System'),
      'parameter' => array(
        'key' => array(
          'type' => 'text',
          'label' => t('Key'),
          'description' => t('A key to identify the e-mail sent.'),
        ),
        'to' => array(
          'type' => 'text',
          'label' => t('To'),
          'description' => t("The mail's recipient address. The formatting of this string must comply with RFC 2822."),
        ),
        'cc' => array(
          'type' => 'text',
          'label' => t('CC Recipient'),
          'description' => t("The mail's carbon copy address. You may separate multiple addresses with comma."),
          'optional' => TRUE,
          'allow null' => TRUE,
        ),
        'bcc' => array(
          'type' => 'text',
          'label' => t('BCC Recipient'),
          'description' => t("The mail's blind carbon copy address. You may separate multiple addresses with comma."),
          'optional' => TRUE,
          'allow null' => TRUE,
        ),
        'from_name' => array(
          'type' => 'text',
          'label' => t('Sender name'),
          'description' => t("The sender's name. Leave it empty to use the site-wide configured name."),
          'optional' => TRUE,
          'allow null' => TRUE,
        ),
        'from_mail' => array(
          'type' => 'text',
          'label' => t('Sender e-mail address'),
          'description' => t("The sender's address. Leave it empty to use the site-wide configured address."),
          'optional' => TRUE,
          'allow null' => TRUE,
        ),
        'reply_to' => array(
          'type' => 'text',
          'label' => t('Reply e-mail address'),
          'description' => t("The address to reply to. Leave it empty to use the sender's address."),
          'optional' => TRUE,
          'allow null' => TRUE,
        ),
        'list_unsubscribe' => array(
          'type' => 'text',
          'label' => t('Unsubscription e-mail and/or URL'),
          'description' => t("An e-mail address and/or a URL which can be used for unsubscription. Values must be enclosed by angle brackets and separated by a comma."),
          'optional' => TRUE,
        ),
        'subject' => array(
          'type' => 'text',
          'label' => t('Subject'),
          'description' => t("The mail's subject."),
          'translatable' => TRUE,
        ),
        'body' => array(
          'type' => 'text',
          'label' => t('Body'),
          'description' => t('The mail\'s HTML body. Will be formatted using the text format selected on the <a href="@url">settings</a> page.', array(
            '@url' => url('admin/config/system/mimemail'),
          )),
          'sanitize' => TRUE,
          'optional' => TRUE,
          'translatable' => TRUE,
        ),
        'plaintext' => array(
          'type' => 'text',
          'label' => t('Plain text body'),
          'description' => t("The mail's plaintext body."),
          'optional' => TRUE,
          'translatable' => TRUE,
        ),
        'attachments' => array(
          'type' => 'text',
          'label' => t('Attachments'),
          'description' => t("The mail's attachments, one file per line e.g. \"files/images/mypic.png\" without quotes."),
          'optional' => TRUE,
        ),
        'language' => array(
          'type' => 'token',
          'label' => t('Language'),
          'description' => t('If specified, the language used for getting the mail message and subject.'),
          'options list' => 'entity_metadata_language_list',
          'optional' => TRUE,
          'default value' => LANGUAGE_NONE,
          'default mode' => 'selector',
        ),
      ),
      'provides' => array(
        'send_status' => array(
          'type' => 'boolean',
          'label' => t('Send status'),
        ),
      ),
      'base' => 'rules_action_mimemail',
      'access callback' => 'rules_system_integration_access',
    ),
    'mimemail_to_users_of_role' => array(
      'label' => t('Send HTML mail to all users of a role'),
      'group' => t('System'),
      'parameter' => array(
        'key' => array(
          'type' => 'text',
          'label' => t('Key'),
          'description' => t('A key to identify the e-mail sent.'),
        ),
        'roles' => array(
          'type' => 'list<integer>',
          'label' => t('Roles'),
          'options list' => 'entity_metadata_user_roles',
          'description' => t('Select the roles whose users should receive the mail.'),
        ),
        'active' => array(
          'type' => 'boolean',
          'label' => t('Send to active users'),
          'description' => t('Send mail only to active users.'),
        ),
        'from_name' => array(
          'type' => 'text',
          'label' => t('Sender name'),
          'description' => t("The sender's name. Leave it empty to use the site-wide configured name."),
          'optional' => TRUE,
          'allow null' => TRUE,
        ),
        'from_mail' => array(
          'type' => 'text',
          'label' => t('Sender e-mail address'),
          'description' => t("The sender's address. Leave it empty to use the site-wide configured address."),
          'optional' => TRUE,
          'allow null' => TRUE,
        ),
        'reply_to' => array(
          'type' => 'text',
          'label' => t('Reply e-mail address'),
          'description' => t("The address to reply to. Leave it empty to use the sender's address."),
          'optional' => TRUE,
          'allow null' => TRUE,
        ),
        'subject' => array(
          'type' => 'text',
          'label' => t('Subject'),
          'description' => t("The mail's subject."),
          'translatable' => TRUE,
        ),
        'body' => array(
          'type' => 'text',
          'label' => t('Body'),
          'description' => t("The mail's message HTML body."),
          'optional' => TRUE,
          'translatable' => TRUE,
        ),
        'plaintext' => array(
          'type' => 'text',
          'label' => t('Plaintext body'),
          'description' => t("The mail's message plaintext body."),
          'optional' => TRUE,
          'translatable' => TRUE,
        ),
        'attachments' => array(
          'type' => 'text',
          'label' => t('Attachments'),
          'description' => t("The mail's attachments, one file per line e.g. \"files/images/mypic.png\" without quotes."),
          'optional' => TRUE,
        ),
        'language_user' => array(
          'type' => 'boolean',
          'label' => t("Send mail in each recipient's language"),
          'description' => t("If checked, the mail message and subject will be sent in each user's preferred language. <strong>You can safely leave the language selector below empty if this option is selected.</strong>"),
        ),
        'language' => array(
          'type' => 'token',
          'label' => t('Fixed language'),
          'description' => t('If specified, the fixed language used for getting the mail message and subject.'),
          'options list' => 'entity_metadata_language_list',
          'optional' => TRUE,
          'default value' => LANGUAGE_NONE,
          'default mode' => 'selector',
        ),
      ),
      'provides' => array(
        'send_status' => array(
          'type' => 'boolean',
          'label' => t('Send status'),
        ),
      ),
      'base' => 'rules_action_mimemail_to_users_of_role',
      'access callback' => 'rules_system_integration_access',
    ),
  );
}