The Stack Overflow podcast is back! Listen to an interview with our new CEO.

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
1
vote
2answers
375 views

How to check if user has passed the quiz already before granting user points?

I'm awarding users points for passing a quiz successfully. However, there's nothing stopping the user taking the quiz again and again to score more points. I have thought of these options, but I don'...
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
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 ...
1
vote
2answers
627 views

How to grant permissions for some role to execute custom Rules Components?

I created a view (table) and i asociated views bulk operations. I created 4 rules components. I have permissions only for user/1 (admin). Another user role (eg. editor) can't see these options. "...
1
vote
2answers
307 views

How to use Rules to perform a simple anti-spam validation using specific keywords?

My site is under repeated attacks by spammers who create accounts manually with nonsense email addresses and "fake" IP addresses (no way to block them). I came up with the idea of blocking node ...
1
vote
1answer
112 views

If field date is 15 days away from today, change another field value

OK, this is specific: I have a content type with two fields: First is a expiration date field (d-m-y format); Second is a select list field: "green, red, yellow, empty" WHAT I NEED: When there 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 ...
0
votes
1answer
108 views

Taxonomy Term Field of a Reference Field in a Product not available in Data Selector for CheckOut Rules

I installed Drupal Commerce Kickstart 2 with drupal version 7.54 and drupal commerce Version: 7.x-1.14. My problem is I want to send email to the store owner every time an order is completed. So in ...
0
votes
1answer
547 views

How to programmatically create forums and containers (not forum topics)?

I need to create containers and forums using rules. If I use the action "Create new entity" -> "Taxonomy term" I got that by default the new term created is treated as a forum, not a container. How ...
0
votes
2answers
217 views

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

I have a content type that has 3 term reference fields: Field A, required, is a term reference using a vocabulary with machine name vocabulary_a. Field B, required, is a term reference using a ...
0
votes
2answers
212 views

Can I hide date field if older than a certian time using Rules?

I want to know if I can hide the values of a date field if the values are older than a certain time. The website is built with Drupal 7, and Display Suite.
15
votes
2answers
4k views

Send email notification when a new comment is posted

I'm using Drupal 8.1 with Rules 8.x-3.0-alpha1. I want to create a rule to send an email to the author of a node when a new comment is posted to this node. Problem is I didn't get the email address ...
5
votes
3answers
7k views

Commerce/Rules - Multiply the price by a custom field value

In my Drupal Commerce store, I have a field called Commission. The Commission is input as a percentage (i.e. its not a fixed global value). I need the final price to be updated so it incorporates ...
6
votes
2answers
2k views

Commerce partial payment : pay deposit at checkout and full settlement later

In a Travel Booking website, how can I configure checkout so that customers pay only a n% deposit of the order total at checkout (off-site payment ATOS solution) ? If the order is created : less ...
5
votes
1answer
408 views

How do I create a Rule “When role is removed, send email to the user”?

I am trying to create a rule that sends an email to the user when a role has been removed from their account. I can't seem to find a rule reaction under User "When role is removed". How do I create a ...
1
vote
2answers
2k views

How to create a rule to send an email when someone creates content of selected type(s)?

I'm trying to create a rule (using the Rules module 8.x-3.x-dev) to send an email when someone creates content that is of the type Announcement or Article, but I can't seem to get the event to trigger ...
6
votes
2answers
10k views

How should I use token_replace()?

Could somebody give me an example of how to use token_replace()? I'm trying to write a custom PHP rule for the Rules module that will rewrite few fields of a new saved content, using the values from ...
3
votes
1answer
9k views

How can I import the contents of an uploaded csv file into a drupal managed table using rules custom php?

I am using drupal 7 and have the data module managing/adopting a table I have manually added to my drupal db. What I was hoping was that when a csv file is uploaded via a specific content type I could ...
2
votes
3answers
2k views

Schedule Migrate to import XML data regularly

Is it possible to schedule Migrate to import/update my XML regularly, say, once an hour? Maybe in Rules? EDIT: I have a skeleton of a module written for this now, to hook into Rules. Event: If ...
2
votes
1answer
2k views

Rules: after saving new content + after updating existing content both triggered on node create

I have two rules - Triggers - after new content is saved Triggers - after updating existing content Problem When I create a new node both rules are getting triggered together. Probable Cause I ...
2
votes
1answer
2k views

Drupal Commerce: How to perform a complex calculation of order's final cost (VATs & discounts)?

Here's is what I want to accomplish: There are 2 taxes in my country: 6.5% & 23%. Every product has to be matched with 1 of these 2 VATs (I'm currently using a taxonomy vocabulary holding these 2 ...
1
vote
1answer
2k views

How can I use Rules to publish nodes depending on changing the value in a Field?

I would like to set up rule to detect if I change one specific field in the content type. For example if I choose the field "dyzury", then the rule will publish this node to the front page with the ...
5
votes
3answers
2k views

Is it safe to use php within a Rules condition?

Using Rules I need a condition which checks if the logged in user has authored a given content type. It seems that I need some custom php for this and I found the code below from a post on drupal.org,...
4
votes
3answers
2k views

Setting automatically created taxonomy terms using rules module

I am using the rules module to automatically create a taxonomy term when i create content of a certain type. I would also like to automatically populate the taxonomy term reference in the the created ...
3
votes
1answer
146 views

Can a VBO form be integrated with the Commerce Add-to-Cart form to allow adding optional add-on products with checkboxes?

With VBO and Rules I can display a list of Commerce products with checkboxes and a button to add the checked products to the cart (see how). Is there a way to integrate these checkboxes with the ...
3
votes
5answers
2k views

How can I assign users different profile pictures upon registration based on gender?

My setup: I am on Drupal 7 but not using the default user profile pictures; instead, I have a custom image field, profile_picture, which is attached to the user profile. When users register, they ...
3
votes
1answer
209 views

How to run the Flags module after the Rules module?

As a sequence on this question, I'd like to deduct 2 User Points when a user's first reaction on an Article is deleted (I mentioned my flag 'First reaction' there). I created a Rule 'Reaction removed' ...
3
votes
1answer
7k views

How do I Send HTML Emails via Rules?

The Rules module provides a value field for the "send mail" action. Since I also have the PHP filter module, I have the ability to add PHP code there. I want to add HTML formatting to my email. Is ...
3
votes
1answer
2k views

Populating a node reference field using PHP in Rules

I have a rule which is triggered when a node is flagged. Currently, the rule loads some content (1) that has been referenced by a field on the flagged content. I have set the rule to create a new ...
2
votes
1answer
1k views

How can I e-mail the content of a view to myself with Rules?

I'm using Drupal 7, Views 3.5, and Rules 2.2. I have a view that provides a page accessible only to admin users on my site, and once a week I would like to e-mail the content of that page to myself. ...
2
votes
1answer
621 views

How to check in a rule if the data from a field collection has changed?

I want to add a rule (using the Rules module) for printing a message after changing a field in a field collection. The field collection consists of the following three fields: Reference to Version (...
2
votes
1answer
2k views

Module that provides Rules action to create node?

Is an Action to create a node available in any module? I tried searching but couldn't find it. I was hoping something as basic as a node create action would be available.
2
votes
3answers
1k views

How to apply an image style based on a condition (a date for ex.)?

I'm looking for a way to apply a grayscale image style to a content type image field when certain conditions are met. A date is reached (date field) for example Can the rules modules do this ? ...
1
vote
2answers
2k views

Redirect node type to a view

I have created a view that lists all the nodes of a certain type. If you go to view the node on it's own page I would like it to forward to my view. I tried doing this using rules but as I display the ...
1
vote
2answers
5k views

How to programmatically add/modify a rule?

Hello, I have the Rules module. I tried to programmatically create or modify a rule but it doesn't work. What I tried so far : I created the MY_MODULE.rules_defaults.inc file and wrote this code : ...
1
vote
2answers
147 views

Create a content node from another content

I'm wondering how to create a content from another content. I'll give an example, it will be easier to understand : We have a content-type "Planning" which has three fields : 2 user references and ...
1
vote
3answers
3k views

How can I check if the author of the current node is the current logged in user?

I am trying to execute a Rule based on the condition of whether the currently logged in user, is currently viewing their node (a node they are the author of), or viewing someone else's node. The Rule ...
10
votes
2answers
2k views

How to set Rules event for “Content is viewed” from excluding Teaser view?

I set up a Rule that will execute during the "Content is viewed" Event and the action was to show a system message. It worked and was triggered when I viewed the node. However, when I went to the ...
6
votes
1answer
2k views

Convert an exported rule to a programmatic rule

I created a Rule through the GUI and it works fine. I would like to convert this into a programmatic rule that I can include with my custom module. This way I dont have to re import my rule every ...
5
votes
1answer
711 views

How to show messages starting with “Debug : ” to an administrator only?

I'm developing a lot of complex rules in D7 and for debugging reasons it is very handy to have different messages (the standard Drupal message) within the website. For this I use "showing a message on ...
5
votes
3answers
790 views

How to use the Rules module to award userpoints to referring users?

I am creating a referral program on Drupal. I have almost everything working right except awarding userpoints to users. I want to award userpoints to users after the person they refer to the site ...
5
votes
1answer
1k views

Entity Reference with VBO and Rules

I am trying to create a rule which fires after modifying node content. Specifically I want to modify the entity reference field values of all the node entities provided by VBO. So I created a rule and ...
5
votes
2answers
2k views

How can I check whether a username is in use?

On creating a "course" content, i am creating a dummy user as its "instructor". Here is the related question. I wasn't able to add a condition to the rule that creates the user, that checks whether a ...
4
votes
1answer
2k views

I can't access a provided variable in rule action

In a rule I have 2 actions, the first one provides a variable (my_var_name). But in the second action this var is not shown as available. I can't figure out what the problem is.
4
votes
2answers
134 views

How to create missing rules event when user flags a statuses updates?

The problem: Rules events are missing. EVENT 1. user flagged a statuses and EVENT 2. user flagged a fbss_comment. Everything is available, just need to add these events. Status updates are created ...
3
votes
2answers
274 views

How to check with the Rules module if a user has a custom picture?

I'm using the Rules module, and I have a rule with these Rules Events: After saving a new user account After updating an existing user account Within the Rules Conditions, I try to put "Data value ...
3
votes
2answers
604 views

How to delay sending emails using Rules to avoid being considered as a spammer?

I created a rule for users, who subscribed on another user to get messages of this user new content: Events EVENT After saving new content Conditions ELEMENTS None Actions ELEMENTS ...
3
votes
1answer
2k views

How do I set up an action to email all users with a certain role?

I'm using Rules 7.x-2.6 and the way it works has changed a bit since I last saw. I have a rule as follows: EVENT A node has been flagged, under "Report content" CONDITIONS None ACTIONS Send mail ...
3
votes
1answer
384 views

How do I sell points using a new product type?

With the Drupal commerce module, I created a new product type I use for selling points to my customers. The product has a custom field named “points” (field type integer) where I specify the amount of ...
3
votes
1answer
2k views

What is the correct token for a multi value field?

Oke, so I have this multi value field in drupal 7 and I want to use it's values in a custom php snippet in the rules module. I found the Array Tokens module to generate an array of the values, but ...