Using Loop in Action for email recipient list but filtering out specific loop items
I am using a Loop in Actions to generate a list of email recipients.
This list is based on a reference field in the node.
The field is generated from a view and is based on the node author's 'friends' (friended via the user relationship module). The node author has selected which friends can view the specific node when created.
I have a child action under the loop to email the friends the node author has selected--via the reference field--for this node. The rule in general is triggered when the node or comments are created or updated.
Read moreDifferent kinds of loops with Rules
One of the most useful parts of Rules is the "list loop" functionality. But I'm having a hard time figuring out how to do other kinds of common loops, like while() and for() loops.
My use case is simple. People can buy e-cards at the (Commerce-powered) web-store. When you buy an e-card, Rules handles sending the actual card. When you buy 3 of an e-card, it should send out 3 emails. But quantity is just a field on the line-item. So I'd like something like this:
<?pseudo-code
$quantity=[commerce-line-item:quantity];
do while ($quantity > 1) {
Read moreLoop through users and/or roles
It is possible to loop through each registered user? What about user roles?
Here's a real use case.
I want to run a club; be it a book club or a night club, doesn't matter. Being a club, it must have members i.e. users with a particular user role applied ("member"). Each user membership lasts for a certain period of time ("membership period"), let it be one hour, 6 months or 20 years, doesn't matter.
[member] users have a field named "expiration" which contains the user creation timestamp with the [membership period] applied.
Read more