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 " mimemail" action).Īs 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.Īfter you completed the previous step, there is no more need for the existing (last) Rules action about " mimemail", so just delete that Rules Action. As you will notice while creating a similar Rules Action, you'll now be able to select/specify tokens that relate to. The actual Rules Action to add is similar to the (last) Rules Action you already have, with machine name " mimemail". That way the Rules Action you add, will be performed as part of the loop. Within that loop you added, use the link to the right of it (in the Rules UI), to "Add an action". List item: Single node with status sendmail (single_node_with_status_sendmail).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. What you need to do to repair your Rules Actions, are these steps:ĪFTER your first Rules Action (which fetch those nodes, and which is fine), use the link "Add a loop" as the next (2nd) Rules Action. , entity-fetched:3, correspond to your 1st, 2nd, 3rd and 4th node in that list of fetched entities (nodes). 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 nodes_with_status_sendmail).Īs you seemed to have understood already, the entity-fetched:0. If you're not familiar with such loops, then I strongly recommend to have a look at the tutorial titled " Lists and loops". Your Rules Events and Conditions are pretty sure OK, but you're missing a crucial Rules Action: a Rules Loop. I would like to have the complete list with these flagged nodes. In the section Replacement patterns for Fetched entity I only have till available. The problem I'm facing here is that I have to put in the email body tokens like, , etc. The list with nodes with the field-status set to "sendmail" is indeed send out. Provides variables: Fetched entity (entity_fetched)" "Parameter: Entity type: Node, Property: Status, Value:, Limit result count: 100 Set the value to 1.I try to send a list of nodes with certain value in a specific field via the Rules module.Įvent: "After updating existing content of type M圜ontentType"Ĭonditions: "Parameter: Data to compare:, Data value: sendmail" For this set the parameter to the variable you created when you set up the component. Under Actions, choose Add action and select the Set a data value option. This makes the condition return TRUE if the current line item is a dangerous item. In my case I just had a checkbox, so I used Data value is empty and checked the Negate box. Lastly add a data comparison to check the status of the dangerous goods field. Then add another Entity has field and select your field_dangerous_goods field from line-item:commerce-product. Under Conditions, add Entity has field, select commerce_product. For the variables, add Commerce Line Item as a Parameter and add a Integer as Provided.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |