Thanks for picking up the ball with this project! I'm looking forward to testing this, particularly in the D7 version.

Question: Any future plans to support a "Sign up a user" action? Or can this already be done? Basically, it would be a programmatic way via Rules to add an individual user to a signup list without actually requiring them to fill out the sign up form.

So, for instance, they could make a Drupal Commerce purchase and then be automatically signed up for a specific event.

Thoughts?

--Ben

Comments

jordojuice’s picture

Wow. Thats a great idea! And a good use case you mentioned.

This can certainly be done. All that is needed is a node and a user and from that I can easily programmatically populate the signup data and save it. Maybe I could even provide form elements so some of the signup data can be populated with user tokens, like email. That is a good one! This will definitely be implemented before a stable release.

I was just testing the D7 version and I released a development snapshot of it. It's not up yet though. The Signup data type ended up being easier to implement than it was in Rules 1 since Rules 2 seems to handle parameters much better. However, I still have to get a hold on adding form elements for conditions and actions in Rules 2. I think it requires a class. But once that happens I can add some of the other conditions from the D6 version.

jordojuice’s picture

Version: 6.x-1.0-alpha2 » 7.x-1.x-dev
Status: Active » Needs work

This feature has been tested and committed to 6.x (like I said, fago made it easy to work with Rules!), but the 7. x branch needs some work on this. I will get back to it soon though!

jordojuice’s picture

Do you have any other suggestions for conditions or actions? I've already implemented a couple more actions, send mail to all users sign up from content from #1200900: Send mail to all users signed up for content and cancel signup. Now is the time to add features, as once there is a full release of either version no additional features will be added to that version unless a version 2.0 is ever planned, which I don't think will ever be necessary as this is such a small and simple module. I know you're interested in a 7.x version, which is in the works. Feel free to contribute! It is in the repository but I am not releasing a snapshot until I get some bugs fixed and tested. Namely, I was testing it today and the open and close signups for node actions are not working. This is my first experience with Rules 2. Some parts have been great, implementing data types and providing form elements and basic validation without callbacks. It looks like you have some experience though, so please don't hesitate! : )

BenK’s picture

Some thoughts:

a. Is "Cancel a signup" the inverse to "Sign up user to content"? It would be very useful to be able to programmaticly remove a user from a particular signup list.

b. I'm wondering if the "Send mail to all users who are signed up" code could also be adapted to support the following:

* Send mail to all users who attended
* Send mail to all users who signed up but didn't attend.

Those actions would be very useful for post-event follow up.

--Ben

jordojuice’s picture

> Is "Cancel a signup" the inverse to "Sign up user to content

Indeed. It just calls core action signup_cancel() (?) in Signup for this, as do the mark attended/not attended actions. It will cancel an individual signup, however, I think there needs to be a better way to load a signup. As of now, the only way to have a signup object loaded is if a user signed up for content or a signup was cancelled or changed. This means that the cancel signup action is essentially useless. However, an individual signup could be easily loaded with a user and a node that are already loaded in the rule.

> * Send mail to all users who attended

> * Send mail to all users who signed up but didn't attend.

Great ideas! These should all be implemented in the same action I think, with form options for limiting the mail action. Thanks! I'll work on this. I'll have to add support for sending mail based on signup statuses in Signup Status Rules module as well.

BenK’s picture

Sounds great. Yes, a more robust and flexible way to load a signup would be very helpful for a lot of different use cases. :-)

--Ben

jordojuice’s picture

Status: Needs work » Fixed

Awesome. Works great. Thanks for the suggestion. Committed to HEAD.

jordojuice’s picture

Status: Fixed » Active

This needs to be ported to D7 now.

I also improved the mail form to be more like the core mail form in Rules, with an optional "from" field on top of the options to select "all", "attended", or "not attended" users.

jordojuice’s picture

> particularly in the D7 version.

I thought you might be interesting that I'm also finishing up a port of the Rules Forms Support module, which was included in the Rules package until Drupal 7. fago intends to create an entity based alternative to the forms support module, so he asked to have it separated into a different project. I don't know if you were a user of Rules Forms Support, but I never used it much until I took on this project. I'm interested in knowing if I'm going in a good direction. I kind of dislike a bit how it has to work (as do klausi and fago), and I just finished redeveloping some actions to make it a little easier to use. Form elements can now be individually loaded or created (neither of which existed before), so those form elements can be accessed through the data pointer instead of using the element ID in all actions. Really, 'loaded' just means that the module stores the index of the form element to reference in other actions. It would be ideal to make other changes to the way forms and their elements are identified overall.

BenK’s picture

@jordojuice: Interesting. Thanks for letting me know about Rules Forms Support. I'll take a look.

Also, we've been trying to work on rules support for the D7 version of Content Access (http://drupal.org/project/content_access). You seem very knowledgable about Rules... do you mind taking a look and/or helping up clean it up? We've got an official 7.x-1.x branch (http://drupal.org/node/1057200) and a discussion thread (http://drupal.org/node/1058526). Can you let me know what needs to be cleaned up from a code level?

Thanks,
Ben

jordojuice’s picture

Great module. I certainly will take a look at this tonight. Always like a new project!

jordojuice’s picture

Status: Active » Fixed

Added 'Load signup data' action. It requires a node and user to be loaded in the rule - either passed by the event or loaded manually. I think this could still be useful in cases where "content is being viewed". Check if "User is signed up to content" and then load the signup data if so. So there are certainly uses for this, and it is a definite improvement.

jordojuice’s picture

Hey BenK. I am releasing a beta version of Signup Rules 7.x and I would love to hear any feedback you have once you've tried it out. I'm glad I found a user that is using Drupal 7 to test it with. I have ported and tested all of the events from Signup Rules for D6 (I recently added events to distinguish whether users signed up from the content Signup form or the user registration form and events for when signups are marked attended/not attended), and I've done what testing I could on the rest of the conditions and actions. I'm eager to get it out there and see what the result of the port is. At this point I'm fairly confident that it's as stable as it's predecessor, but I'll need some "guinea pigs" to verify that before I can think about creating a full release. Be patient though, you might have to update the module often as I expect that changes will continue to be made quite frequently. Thankfully, the nature of Rules is such that frequent changes will rarely if ever do any harm to a site. The only changes that could destroy existing Rules would be changing event, condition, or action keys, and I won't do that. It will likely only be minor bug fixes or rewording of descriptions as long as nothing major appears.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.