How to check the remaining capacity for an event when using the Registration module? I am trying to create a Rule (using the Rules module) that fires off an email when the capacity of registrations for an event get full. We have set this up using the Registration module.

I set this rule up like so:


Event = Upon new registration.
Condition: Data comparison - registration:count.
Action = email author.


In the manage registrations tab the registration-count is always 1 for each user. So I wonder how I can check the capacity for the event to trigger the email.

I have tried to search for information and try many scenarios, however not finding one that works.

I would like some idea(s) or path to a solution I am not thinking of.
The Rules module is a very flexible framework and it has a comprehensive api. While you may be able to accomplish your task using just the UI you may find it easier implement one or couple of hooks to alter your existing condition, or perhaps, add a new condition to be used. For example,    

/**
 * Implementation of hook_rules_condition_info().
 * @ingroup rules
 */
function yourmodule_rules_condition_info() {
  return array(
    'yourmodule_condition_example' =&gt; array(
      'label' =&gt; t('Compare two users'),
      'arguments' =&gt; array(
        'user1' =&gt; array('type' =&gt; 'user', 'label' =&gt; t('First user to compare')),
        'user2' =&gt; array('type' =&gt; 'user', 'label' =&gt; t('Second user to compare'))
      ),
      'module' =&gt; 'user',
    ),
  );
}


If you decide to go this way, you may want to check https://drupal.org/node/298533