You are here

function pet_rules_action_info in Previewable email templates 8.3

Same name and namespace in other branches
  1. 8.4 pet.rules.inc \pet_rules_action_info()
  2. 8 pet.rules.inc \pet_rules_action_info()
  3. 7 pet.rules.inc \pet_rules_action_info()

Implements hook_rules_action_info().

File

./pet.rules.inc, line 17
Rules integration for the Pet module.

Code

function pet_rules_action_info() {
  $actions = [
    'pet_action_send_pet' => [
      'label' => $this
        ->t('Send Pet mail'),
      'group' => $this
        ->t('Previewable email templates'),
      'parameter' => [
        'pet_name' => [
          'type' => 'text',
          'label' => $this
            ->t('The previewable email template to use'),
          'options list' => 'pet_pet_list',
          'description' => $this
            ->t('The template that will be sent for this action. You can see the full list or add a new one from <a href="@url">this page</a>.', [
            '@url' => Url::fromRoute('pet.list'),
          ]),
        ],
        'to_text' => [
          'type' => 'text',
          'label' => $this
            ->t('Recipient(s) (for sending to a fixed set of email address(es))'),
          'description' => $this
            ->t('The e-mail address or addresses where the message will be sent to. The formatting of this string must comply with RFC 2822. Either this or the variable recipient below must be provided.'),
          'optional' => TRUE,
          'default value' => NULL,
        ],
        'to_account' => [
          'type' => 'user',
          'label' => $this
            ->t('Recipient (for sending to a user provided by a Rules event)'),
          'description' => $this
            ->t('Send mail to address on this account. Either this or the fixed recipient(s) above must be provided. If both are provided, this overrides the fixed list.'),
          'optional' => TRUE,
          'default value' => NULL,
        ],
        'account_subs' => [
          'type' => 'user',
          'label' => $this
            ->t('User for token substitutions (if any)'),
          'description' => $this
            ->t('If your template includes user tokens, this user will be used for them.'),
          'optional' => TRUE,
          'default value' => NULL,
        ],
        'node_subs' => [
          'type' => 'node',
          'label' => $this
            ->t('Node for token substitutions (if any)'),
          'description' => $this
            ->t('If your template includes node tokens, this node will be used for them.'),
          'optional' => TRUE,
          'default value' => NULL,
        ],
      ],
    ],
  ];
  return $actions;
}