How to get a complete list
Your Rules Events and Conditions are pretty sure OK, but you're missing a crucial Rules Action: a Rules Loop. If you're not familiar with such loops, then I strongly recommend to have a look at the tutorial titled "Lists and loops".
The result of your first Rules Action is actually a list, which as per the "PROVIDE" that is shown in your exported rule, is stored in a variable named
entity_fetched (BTW, try to use a more meaningful variable name for such variables, eg
As you seemed to have understood already, the
entity-fetched:3, correspond to your 1st, 2nd, 3rd and 4th node in that list of fetched entities (nodes).
What you need to do to repair your Rules Actions, are these steps:
AFTER your first Rules Action (which fetch those nodes, and which is fine), use the link "Add a loop" as the next (2nd) Rules Action. When doing so, specify these options for it (note the looooong variable name for my 'List item', I bet you get its meaning just from its name ...):
- Parameter: List: [entity-fetched]
- List item: Single node with status sendmail (single_node_with_status_sendmail)
Within that loop you added, use the link to the right of it (in the Rules UI), to "Add an action". That way the Rules Action you add, will be performed as part of the loop. The actual Rules Action to add is similar to the (last) Rules Action you already have, with machine name "
mimemail". As you will notice while creating a similar Rules Action, you'll now be able to select/specify tokens that relate to ...
single_node_with_status_sendmail. However, the content of your eMail message body should now only (repeat: only!) refer to the "List item" being processed in the current iteration of the Rules loop (instead of those 4 items in your existing "
As you will probably understand, since you're now processing 1 single node in each iteration, and it doesn't matter how many nodes you have in your list of nodes, there is no more restriction to 4 nodes only.
After you completed the previous step, there is no more need for the existing (last) Rules action about "
mimemail", so just delete that Rules Action.
With these changes you solve your limitation of 4 nodes maximum. However, in case you don't realize yet, you may have introduced a new challenge, as detailed below ...
Solution to your problem ... might (will?) change the problem
Using the approach detailed above, the result of your adapted rule is that you will get 1 separate eMail for each node fetched via that first Rules Action (which created the list of nodes to be processed). If you typically only have a few nodes that may not be a real issue to worry about. But if you have dozens (or more?) of such nodes then you might want to consider consolidating all such eMails in a single eMail, which contains (in its eMail body) the complete list of nodes.
A possible solution to implement such consolidation, is similar to what is shown in the Rules example included in my answer to "How to concatenate all token values of a list in a single field within a Rules loop?". In your case, you could make it work like so:
- Add some new Rules variable that will be used later on as part of the eMail body, before the start of your loop. Say you name the variable
- Within your loop, for each iteration, prepend or append the value for each "list item" to that variable
- Move your (new) "
mimemail" action outside your loop, and after the loop completed. And finetune the details (configuration) of your (new) "
mimemail" Rules Action. When doing so, you'll be able to select the token for
nodes_list_var_for_email_body to include anywhere in your eMail body.
If you think about it, you'll end up more or less with a variation of the last Rules Action in the rule you already have, in which the body part now contains
nodes-list-var-for-email-body instead of
But for this (crucial)
nodes-list-var-for-email-body token to be available, you need to (a) add the Rules Loop and (b) add 2 more Rules Actions to create the content (value) of
... That's really all it takes to get this to work.