Hi all,

i have created a custom rule event as follow

function my_module_rules_event_info() {
  return array(
    'my_module_a_form_is_submitted' => array(
      'label' => t('A form is submitted'),
      'module' => 'my_module',
      'group' => 'Custom' ,
      'arguments' => array(
        'acting_user' => array('type' => 'user', 'label' => t('The user who submit the form.')),
        'article' => array('type' => 'node', 'label' => t('An article node.')),
        'a_number' => array('type' => 'text', 'label' => t('A number.')),
      ),
    ),
  );
}

I invoke the above event after a form submission.

  ...
  rules_invoke_event('my_module_a_form_is_submitted', $user, $article, 123);
  ...

In the condition part, i use the "Execute custom PHP code" which always return TRUE.

Then i add a "Send HTML e-mail". but i couldn't find the acting_user, article and the number which i pass in during the rules_invoke_event() in neither replacement pattern or php evaluation.

Is there anyway i could retrieve those values in the "Send HTML e-mail"?

Thanks

Comments

ykyuen’s picture

Status: Active » Closed (fixed)

I can make use of the replacement pattern and php evaluation after i changed the key arguments to variables.

function my_module_rules_event_info() {
  return array(
    'my_module_a_form_is_submitted' => array(
      'label' => t('A form is submitted'),
      'module' => 'my_module',
      'group' => 'Custom' ,
      'variables' => array(
        'acting_user' => array('type' => 'user', 'label' => t('The user who submit the form.')),
        'article' => array('type' => 'node', 'label' => t('An article node.')),
        'a_number' => array('type' => 'value', 'label' => t('A number.')),
      ),
    ),
  );
}
sgabe’s picture

Project: Mime Mail » Rules
Version: 7.x-1.x-dev » 7.x-2.1
Component: User interface » Provided Rules integration

I am glad that you were able to sort it out, though this was not a Mime Mail but a Rules issue. See hook_rules_event_info for more information. I am moving this to Rules.

mitchell’s picture

Component: Provided Rules integration » Rules Core

Updated component.

mitchell’s picture

Issue summary: View changes

data type for string should be text