How can I fetch the Inviter of a user in Rules? I'm using Drupal 7 and the invite-by-email module (part of the invite module https://www.drupal.org/project/invite), to allow users to invite others. Now i need to create a Rule that grants points to Inviters whenever their Invitees vote on the site.The voting is controlled with the voting api module, which gives a Rules event. The event is User votes on a Node The Invitee is [vote:user] For the inviter I tried [vote:user:invite:inviter] but it didn't work. Been going around in circles, but just can't find the Inviter.

any help appreciated. d

  • When you post a question like this, recognize that not everyone will know the module you're talking about - Invite is used by less than 2,000 Drupal sites, while Rules is used by more than 200,000 sites. So the chance that a Rules user will be familiar with the module you're using is small. Thus, please post a link to that module so we know exactly which module you're using. – anonymous Mar 22 '20 at 16:59
  • Now you've brought up a new module - Vote? Maybe this is the Voting API (drupal.org/project/votingapi)? Again, you need to be specific - Drupal has something like 45,000 modules, many of which do similar things ... – anonymous Mar 22 '20 at 17:01
  • thank you anonymous. i added details to my question as you suggested – dnoncoder Mar 23 '20 at 5:22

As a workaround, i ended up using the views rules module at drupal.org/project/views_rules which "Provides Views directly as Rules actions and loops to seamlessly use view result data."

  • even though you only consider that as a workaround, it seems to me that is the best possible answer to your question (I think you should mark it "accepted", at least until something better comes along). – Pierre.Vriens Apr 9 '20 at 18:35
  • thank you Pierre... the views-rules-module is becoming my favorite module ;-) – dnoncoder Apr 15 '20 at 9:36
  • ahan I cannot agree more about that ... and just in case you want to read more: drupal.stackexchange.com/a/214511/39516 ... – Pierre.Vriens Apr 15 '20 at 10:01

If you're trying to do something, please show your work so we don't have to guess what you've tried. The variables available to Rules depend on what events you're using, so leaving that part out of your description means we can only guess how to help you. A great way to communicate how you've configured your Rule is to post an export of the Rule you're writing and point out where you're having the problem.

That said, here is a very simple Rule which displays the name of the 'inviter' when a new invitation is created. You can import this and modify it for your specific needs. I used the Invite module from https://www.drupal.org/project/invite

{ "rules_test_invite" : {
    "LABEL" : "test invite",
    "PLUGIN" : "reaction rule",
    "OWNER" : "rules",
    "REQUIRES" : [ "rules", "invite" ],
    "ON" : { "invite_insert" : [] },
    "DO" : [ { "drupal_message" : { "message" : [ "invite:inviter:name" ] } } ]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.