Questions tagged [rules]

Use it for questions about the engine which allows site administrators to automate actions: the Rules module.

Filter by
Sorted by
Tagged with
3
votes
2answers
847 views

How to create rule to change user role based on points (using User Points module)?

I'm using the User Points module which allow me to grant points to user. So far so good. I need to create a rule to fire this condition/action: When user points are granted, then check if the user ...
3
votes
2answers
6k views

Change node author on node save with rules

I have a very simple rule with Event "Before saving content" and Elements "Content is of type (page)" and would like the action to be something similar to "Change node author to UID X", which would be ...
2
votes
3answers
210 views

How to use cron to delete nodes of a content type that does not allow deletion by anonymous users

The background for this question is here: Delete nodes using Rules and VBO Summary: a VBO View selects various nodes of a particular content type. A Rules Action Set is instructed to load this VBO ...
2
votes
2answers
3k views

How do I add a new condition in Rules 2?

I can't get my new Rules' condition to work. I wrote the (simple) code below in includes/MYMODULE.rules.inc, and nothing appears in the condition list. /** * Implementation of ...
1
vote
2answers
2k views

Is it possible to add css class to the page's body tag with rules when certain conditions are met? [closed]

I seem to have read that there is a way of making Rules add a css class to the body tag, but I can't find out how to do it. Any ideas?
1
vote
2answers
82 views

How to check with Rules if a new element has been added to a list in a node?

I'm using the Rules module and I would like to make a rule to check wheter a new element has been added to a list in a node. First I have tried "List Count comparison" but it can only compare a list ...
1
vote
1answer
196 views

Email all Organic Group members when a subgroup is created

I have an Organic Groups / subgroups structure where an Organisation is a group, a Property is a child group of an Organisation, and a claim is a child group of a property. So: Organisation > Property ...
0
votes
2answers
1k views

Send user a reminder email after x-number of days if Profile2 field is empty and user has specific role

I have a multi-step user signup process. When the user creates their account, they are assigned role "A" and are redirected to a Profile2 form with various fields. If they complete and save their ...
9
votes
3answers
7k views

Email a Whole Node (Including template contents)

I have created my own custom node.tpl.php file. I now want to email the entire node, each time the user creates a new node of that content type (I have made sure that all the HTML in my node.tpl.php ...
6
votes
5answers
2k views

Rule condition to check which language is used by the visitor?

I have a multilingual website (English, Spanish). Is there any way to create a rule condition to compare the language used by the visitor against a fixed value? The condition would something like: ...
5
votes
5answers
3k views

How can I redirect users upon login sometimes but not break the “Forgot password?” function?

I'm using Rules to redirect users with certain roles upon login using the Page Redirect action. The "Force redirect" option is set to true (changing this to false does not fix the problem, and if it ...
3
votes
2answers
363 views

How to add a new user badge after earning a certain number of user points?

I'm using the User Badges and User Points modules. I want that when a user earns a certain number of user points, the user's old badge is replaced by a new one. For this, I have already created a rule ...
2
votes
2answers
2k views

Email users on node creation based on taxonomy reference

I have 2 taxonomy vocabularies (town and topic) which are referenced on both a user and a node. When a node is created, I need to email all users who are referencing any of the terms referenced on the ...
1
vote
1answer
2k views

How to send email in every 7 days to in-active users that is not logged in since 7 days? [duplicate]

I want to send mail in every 7 days i.e please login site, you are not logged in since 7 days, only for those users which are not logged in since 7 days. I have already created an event i.e After ...
8
votes
5answers
601 views

How to publish nodes 3 times a day?

I have a list of unpublished nodes, created with the Views module. I would like a task to be run 3 times a day, at specified times. Every time the task runs, only one of the nodes on the list should ...
7
votes
2answers
4k views

Disable editing of a node after it has been published

Scenario: A user can create a node (content type "story"). All story nodes that are created are unpublished by default. I have a boolean field called "publish my story". Once this has been checked ...
20
votes
3answers
15k views

How to change a field value with a Rules Action?

I'm trying to set up a Rules Action that can change the value of a field. I created an Action Set with a data type of Node. When I go to create a Rules Action, I have access to every default Drupal ...
6
votes
3answers
6k views

Programmatically import a feed

I can successfully import remote content using the Feeds module by manually clicking on the Import button. I need to execute the import process from code, either from a module or executing PHP code ...
4
votes
1answer
3k views

How to create custom rules action event conditions?

Is there any universal formula or module to create custom rules actions, events and conditions? So that I just have to replace the required values and rest of the code remains the same. I searched, ...
4
votes
1answer
1k views

Send reminder to referenced users day before event date in cck date field

I have a node type called event. An event has a "Event Date" date field, and a "Staff" user reference field. I need to send a reminder emails to all referenced users, 1 day before the event date to ...
3
votes
2answers
365 views

Can the Flag module be used to lock content while editing to prevent concurrent edits?

We are trying to figure out a way to use the Flag module to prevent concurrent editing. In our research, we found the Content locking (anti-concurrent editing) module, but we thought since we are ...
3
votes
2answers
1k views

How to change field cardinality per form either programatically or by rule?

I've a multipage form (where each page is determined by field group) where on the first page user type number of people in text field and on the second one I would like to show X number of field ...
2
votes
1answer
1k views

How to delay the execution of a rule for 5 minutes?

I'm using the module "Facebook Autopost" to post Drupal content on Facebook. When a new node is created, a link to this node is posted on a Facebook page. Facebook's scraper picks up the link and ...
2
votes
2answers
364 views

Rules Conditions being evaluated after schedule time elapsed?

Backstory: I have a content type that will send an email after a period of time if a boolean is true. From the creation of a node to the time the email will be sent, the boolean could change at any ...
2
votes
3answers
213 views

How to have a field that counts the nodes submitted by the current user?

My site with existing content needs a field that shows the number of nodes of a certain content type that have been created by the current user. I can't use Views because the field needs to be able ...
8
votes
5answers
7k views

How do I check if a single on/off checkbox is checked?

There does not appear to be any way to check the value of a single on/off (boolean) checkbox in the data selector for the Rules module. If "field-MyField" = checked or "field-MyField" = 1, then do '...
5
votes
2answers
5k views

Setting a Variable in PHP for use in rules

I have a variable I've defined via rules using 'Add a variable' called 'minimum_reached'. This is available to me for use in custom PHP code. if($total >= $minimum_fund){ $minimum_reached = 'yes'; ...
4
votes
1answer
2k views

Checkout page not found when order created through Drupal Commerce API for not authenticated (anonymous) user

I have the following code inside rules - action (being triggered by webform submission) <?php global $user; $product_id = 1; // Create the new order in checkout; you might also check first to // ...
4
votes
2answers
2k views

Rule to check if a date value is a specific day of the week

I want to set a rule which checks a date of format "2014-09-24 08:43:39" is a Monday using the data comparison rule. I have tried to manipulate the data selector for the date using the ":custom:N" ...
3
votes
1answer
2k views

How do I create a rule that closes comments on node after 30 days?

I am on Drupal 7, and I am trying to make a rule that closes comments on a node 30 days after they have been created. I am assuming I need to make a component that has an action of "set data value:" ...
3
votes
1answer
377 views

Register an anonymous user when entity form is submitted with rules

I have created an entityform called "Order Request". This form has fields for the user to enter their first name, last name, email address, and their order contents. I would like to register this ...
3
votes
2answers
129 views

How to login-redirect users to their profile page on specific days only?

By using Rules Once per Day module, logged in user would be redirected to profile page on specific day. My issue is, every time when user logged in to the site, the user is redirected to profile page. ...
2
votes
1answer
575 views

Schedule an email to be sent to new users a week after registration

I am creating a site in Drupal 8 and would like to be able to schedule an email to be sent to new users. The email should be sent automatically one week after they have registered. In Drupal 7, I ...
2
votes
1answer
4k views

How do I programmatically update an existing submitted webform submission in Drupal?

I am attempting to use PHP in Drupal rules to update the values in submitted webform submissions. I can access and view the data correctly. When I assign a new value to a field it will even show up ...
2
votes
1answer
992 views

How to send an email using a field key?

I am attempting to send an email to a field selected value using the Rules module. The user selects a faculty member and saves the node. The rule should fire off and email based on the field's key. I ...
1
vote
1answer
473 views

How to execute VBO list of nodes in Rules on After updating an existing user account event?

I have a VBO of all the unpublished nodes of the user, and I want to publish all of them based on user role change that happens via Rules. I created a component of rule to list the nodes of that user ...
0
votes
1answer
2k views

how to automatically fill in an entity reference field using rules in Drupal 7?

Since I'm not a coder I'm using the Rules module to automatically create a node of type B when a user creates a node of type A. That works. I used 'create new entity' of 'type B' 'after saving new ...
3
votes
1answer
173 views

How to create a Rule to create a new entity of type Comment and a body with tokens?

Using drupal 7 and the Rules module, I'm trying to "create a new entity" of type comment. What it's strange, is that although all the other fields accept tokens, "the main body text" doesn't. Tokens ...
3
votes
1answer
648 views

How to use Rules to send an eMail with a body containing all items of a field collection?

I've defined a content type that contains a field collection. The field collection contains 4 fields. When the content is created, it may have one or more of the field collections. I set up a rule to ...
3
votes
2answers
494 views

How to send an eMail notification when a specific field of a node or user has been changed?

When a node (or user profile) is modified, is it possible to send an email notification only when a specified field is modified? With the node I have no problem, but I cannot get it to work for a ...
2
votes
2answers
438 views

How to loop over a list of Organic Group users using Rules

When a user requests to join an Organic Group, I want to send an email to the group's admins. I've found this answer (https://stackoverflow.com/questions/16742925/how-to-send-an-email-to-drupal-7-...
2
votes
1answer
385 views

How to send out email based on matching taxonomy terms in user profiles?

I'm using profiles 2 and have (one or many) taxonomy terms that can be selected by a specific profile type. I have a webform that also has this taxonomy term in the select list. When the webform is ...
2
votes
3answers
6k views

How do I schedule a reminder email with Rules to users that have flagged an event?

I have a content type: event It has a single date field: date It has a flag on it: reminder When the user flags the node, I want to schedule a rule to send them an email the day of the event. Can ...
2
votes
1answer
156 views

How to use Rules to email users when any field(s) is changed in a node (and include the unchanged/changed values for that field)?

I know how to email using Rules when a field in a node is changed and add conditions for particular fields whether they were changed. But I would like the email to contain the info which field(s) ...
2
votes
2answers
211 views

How to create a rule to combine the terms of 2 fields to create a new term and store it in a 3rd field?

I have a content type that has 3 term reference fields: Field A (required), which contains a single tag. Field B (required), which contains a single tag. Field C (not required), which contains a ...
2
votes
2answers
320 views

How to specify a Rules condition like 'Before creating new content'?

I need to show an "Add content" link to users but I need to consider user field values to give access to the node form. For example, is the boolean field "Subscription fee paid" is True. I thought ...
2
votes
1answer
1k views

I can't get the SKU value for a commerce product in a rule action

I created a rule to be fired when a "New Commerce product is saved" Then I set a action to create a Product Display node and and another action to set the title for the Product Display to be the same ...
1
vote
1answer
136 views

How to get notifications in a new window when using the Mentions module?

I am using the Mentions module to be able to tag other users in a posts. I also installed the Rules module and made a new rule which sends email and shows a message on site if the logged in user is ...
1
vote
1answer
140 views

Compare two views that present two different content type and delete nodes

this question is like this: How to delete a content in a view with view rules? I didn't know why but i make this question with another account that i cannot got access now So the problem is: I got ...
1
vote
1answer
34 views

Fetch Customer Profile from Line Items

In a webshop I’ve build I want to send individual e-mails to owners of a prodruct in the shop after a product is sold. To do this I got this as a solution: Send mail to product owner with Rules But ...