You are here

function mailchimp_lists_rules_action_info in Mailchimp 8

Same name and namespace in other branches
  1. 7.5 modules/mailchimp_lists/mailchimp_lists.rules.inc \mailchimp_lists_rules_action_info()
  2. 7.2 modules/mailchimp_lists/mailchimp_lists.rules.inc \mailchimp_lists_rules_action_info()
  3. 7.3 modules/mailchimp_lists/mailchimp_lists.rules.inc \mailchimp_lists_rules_action_info()
  4. 7.4 modules/mailchimp_lists/mailchimp_lists.rules.inc \mailchimp_lists_rules_action_info()
  5. 2.x modules/mailchimp_lists/mailchimp_lists.rules.inc \mailchimp_lists_rules_action_info()

Implements hook_rules_action_info().

File

modules/mailchimp_lists/mailchimp_lists.rules.inc, line 11
Rules integration for the mailchimp lists module.

Code

function mailchimp_lists_rules_action_info() {
  $items = [];
  $items['mailchimp_lists_user_subscribe'] = [
    'label' => t('Subscribe or unsubscribe entity from a mailchimp audience'),
    'parameter' => [
      'entity' => [
        'type' => 'entity',
        'label' => t('Entity'),
        'description' => t('The entity to subscribe/unsubscribe'),
      ],
      'field' => [
        'type' => '*',
        'label' => t('Mailchimp Audience Subscription Field'),
        'description' => t('Subscription Field connected to the desired Mailchimp Audience.'),
        'restriction' => 'selector',
        'wrapped' => TRUE,
        'allow null' => FALSE,
      ],
      'subscribe' => [
        'type' => 'boolean',
        'label' => t('Subscribe'),
        'description' => t('True to subscribe, False to unsubscribe'),
      ],
    ],
    'group' => t('Mailchimp'),
    'access callback' => 'mailchimp_lists_rules_access_callback',
    'base' => 'mailchimp_lists_rules_action_entity_subscribe',
  ];
  return $items;
}