In addition to the hooks already provided (hook_invite_send, hook_invite_withdraw, hook_invite_accept), Invite should also provide integration with the Rules module.

CommentFileSizeAuthor
#1 1539336-1-invite-rules-integration.patch4.83 KBmilesw
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

milesw’s picture

Status: Active » Needs review
FileSize
4.83 KB

This patch provides basic integration, giving Rules read-only access to the same data available through hooks. The invite object and user objects are accessible through Rules data selector.

The three Rules events invoked are:
- Invite sent
- Invite withdrawn
- Invite accepted

klucid’s picture

Awesome. I will try to test this out tonight. Thank you!

klucid’s picture

I finally got a chance to test the patch. Works beautifully so far! Thanks so much.

giorgio79’s picture

Status: Needs review » Reviewed & tested by the community
scottsawyer’s picture

Issue summary: View changes

I am testing this patch on 7.x-2.1-beta2, and it does appear to expose Invite to Rules. However, I can't seem to fire a rule based on reacting to event Invitation was accepted.

Maybe if I share my situation it will help:
I have one authenticated user ( user1 ), that user invites anonymous user ( user2 ), which generates an email with the joinlink.
My rule is reacting on event, Invitation was accepted. The goal is to redirect user2 to a special registration page based on conditions.
user2 clicks the link to accept the invitation.
The rule doesn't respond, user2 is directed to the default registration page ( in the invite module ).

My first thought is that I could have problems with my rule, but in the log there are no entries that this rule even tries to fire.

Thoughts?

EDIT:
Well, it actually looks like the rule is in fact working as designed. When user2 actually gets to the registration page, and accepts the invitation, the rule does fire, the user is redirected. This part works. Now if I can just figure out how to redirect the user before they accept ( when they click the join link ) I will be in good shape.

ckng’s picture

Version: 7.x-2.x-dev » 7.x-4.x-dev
Status: Reviewed & tested by the community » Needs work

7.x-2.x is being phased out, so updated patch to integrate with current 7.x-4.x invite.rules.inc would be great.

ckng’s picture

Assigned: Unassigned » ckng