Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#1 | 1539336-1-invite-rules-integration.patch | 4.83 KB | milesw |
Comments
Comment #1
milesw CreditAttribution: milesw commentedThis 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
Comment #2
klucid CreditAttribution: klucid commentedAwesome. I will try to test this out tonight. Thank you!
Comment #3
klucid CreditAttribution: klucid commentedI finally got a chance to test the patch. Works beautifully so far! Thanks so much.
Comment #4
giorgio79 CreditAttribution: giorgio79 commentedComment #5
scottsawyerI 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.
Comment #6
ckng7.x-2.x is being phased out, so updated patch to integrate with current 7.x-4.x invite.rules.inc would be great.
Comment #7
ckng