Questions tagged [rules]

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

3
votes
0answers
66 views

Check if node is flagged after webform submit. Rules

I have a webform block on a node. I'm trying to send emails to the node (field email) after webform is submitted but only if the current node has been flagged (not the webform). I would presume that ...
2
votes
0answers
24 views

How to access the fields of a custom node variable in a custom Rules event?

I have created a custom Rules event, following the instructions in https://drupal.stackexchange.com/a/215857/16550 The event provides a custom node variable: function MYMODULE_rules_event_info() { ...
2
votes
0answers
34 views

How to send notifications with rules to users with access permission to view content?

I have a rule to send an html mail when new content is created, but is not respecting the user permission to access content. Is an Open Atrium site that works with OG. I have a space with 7 teams and ...
2
votes
0answers
29 views

Booking events do not trigger an action and missing in module

Am using the Booking Time Slot module in my project. I configured some booking related Rules and noticed that they were not triggered. While trying to debug the rules configuration, I noticed that ...
2
votes
0answers
71 views

How to replace hook_rules_data_info()?

This question is about Rules on Drupal 8. Reading the documentation, I find information about how to replace many of the hooks, but not hook_rules_data_info. It might be obvious, but please point me ...
2
votes
0answers
66 views

How can I pass values to Rules?

I would like to pass values to Rules (eg an array of words) and then do some Rules magic with them (eg create new nodes if they dont exist already). I found one solution here How to reference ...
2
votes
0answers
198 views

Displaying Token Field Labels From Fetched Entity In Rules HTML Email

I am sending a MIME HTML email using rules. Much of the information contained in the email comes from a fetched custom entity (custom ECK entity). Using the available replacement patterns, I can get ...
2
votes
0answers
19 views

Node/Post number by group

I have multiple OG groups where a person posts within the group and the group is private. I need to have a field on each node that shows the serial/count/id of that node within its group. Example: ...
2
votes
0answers
40 views

Send email to user on new term save depending on flagged content

I have a content type 'my_content' with two nodes. These nodes can be flagged by each user (NOT global flag) with the flag 'my_flag'. This content type has a field 'machine_name'. Now, using feeds I'...
2
votes
0answers
129 views

Is there a hook for rules which I can use in my module to check if a specific rule has been fired?

I want to run some code to add php varible in js file just after my rule run. Rules doesn't support adding js. I can make action to rule using hook_rules_action_info but that does not work because ...
2
votes
0answers
190 views

How to set all subusers created by a user, or their role, to expire on a specific date

I need to create licensing functionality for a website. Part is done: via the subuser module, I can set up a licensing admin who can create a certain number of subusers that function as licenses based ...
2
votes
0answers
103 views

Create node via URL parameters to different drupal site

I am looking for a way to create a node via just a URL. I know the prepopulate module and similar can auto populate a form for a user to submit, but I would like to avoid the form altogether. After a ...
2
votes
0answers
42 views

Does rules take advantage of search api for fetching nodes?

I have a few rules which fetch nodes. I wonder if performance would increase by creating a proper index.
2
votes
0answers
60 views

How to customize my Drupal search?

I have a Drupal 7.x intranet and I am using the Apache Solr Search module as the backend (basic out of the box setup). My site has content types and custom fields, but it is not using tags/taxonomy, ...
2
votes
0answers
125 views

Automatic entityform creation after user registers with rules

I would like to create a draft entityform for every entityform type after a user registers, I've been trying to attempt to create a list of entityforms in rules but can't work out how. This is needed ...
2
votes
0answers
132 views

Rule to change ubercart role expiration when role is granted

I need to 'standardize' the expiration date of a ubercart role as soon as the role is granted. I think I understand what the events and conditions should be. I can't figure out how to create the ...
2
votes
0answers
872 views

How to create a Rules action set to calculate a sum of integers in a Field Collection?

I'm having a Field Collection 'My List' with two fields: 'Amount' (integer) and 'Date' (date). I often count the 'Amount' items with Rules like this: Add a variable: Parameter: Type: Integer, Value: ...
2
votes
0answers
71 views

What token should I use while sending email when I am programmatically adding the content?

When I fill the form. I get this email A new Event "Event name" has been created. To approve this Event please go to http://websitename.com/content/content-name and click ‘publish’. I have set ...
2
votes
0answers
100 views

hide a field using custom php in rules

Drupal 6 only: I have a button field on a petition node for users to sign that petition. I have custom php in a rule to check if they've signed it before. If they have, I need to hide the button. So ...
2
votes
0answers
715 views

Drupal 7: how to rewrite rules replacement patterns programmatically

i try to create different rule conditions or actions and need to rewrite different replacement patterns. for example: defined replacement patterns: [loaded-points:value] [vote:value] i want: if [...
2
votes
0answers
253 views

Error by sending Email in Drupal 7, but ok by Rules?

System messages (Restore Password, Registration) not sending to email and in Logs shows error. But email sending by Rules (Ubercart) very good. What's the problem? Message Error sending e-mail (...
2
votes
0answers
50 views

In D6 Rules, how do I grab a string variable from an event?

I have a D6 Rules custom event(1), that captures a string argument when invoked(2). I also have a custom condition(3) that I want to work in conjunction with this event. I need the string argument ...
2
votes
0answers
586 views

How can I change item->quantity in rule (Commerce Kickstart)

I would like to evaluate line_item -> quantity before line_item is saved. I've created a rule firing on "before line item saved" event. I've added 2 actions: Action variable_add (evaluating desired ...
2
votes
0answers
433 views

Recurring order option on regular products using Drupal Commerce

I have a Drupal site that requires Drupal Commerce and the Commerce Recurring Framework (if I need to switch to UC, so be it). I have come up with a few options but due to vague documentation ...
2
votes
0answers
45 views

Creating multiple entities in rules based on a quantity

I have a field which is a select list of numbers, 1 -10. In rules I would then like to create multiple entities, how many dependant on the quantity selected. Is the possible as I can' for the life of ...
2
votes
0answers
521 views

Rule to send an e-mail with the URL of an uploaded attachment after node change

I have a Drupal 7 site with a custom node type with a custom attachment field. After a (kind of this custom) node has been published, I got an e-mail with the help of Rules module. I would like to set ...
2
votes
0answers
778 views

Calculating shipping rate on country not working - finding workaround

I installed commerce-kickstart 2.0-rc2 and need to set three shipping rates for different countries. I tried it the "obvious way" using flat rates module and rules "Order address component comparison",...
2
votes
0answers
391 views

How do I create a rule that publishes comments on node after 3 days?

In Drupal 7, and I am trying to make a rule that publishes comments on a node 3 days after they have been created. I had a look at this post to see if I can do this in reverse. Workflow: A ...
2
votes
0answers
820 views

Dependency problem with Entity API + Rules + Features at deployment

I'm saving rules in a feature. I added a new rule that has as dependency a module that I added to the project's repo. This new module was correctly added to the feature's dependency list in the .info ...
2
votes
0answers
451 views

'Set the unit price to a specific amount' doesn't work

I'm trying to set unit price amount to some value when order state is changed to canceled. The order always contains only one line item. I want to set total amount of order to $charge's value. The ...
2
votes
0answers
132 views

Rules: how to email “last edited by” user

I am using Rules for a node publishing workflow. When a node is in "needs review" status and an admin either rejects or publishes the draft, I'd like to notify the user who created the draft (i.e. not ...
2
votes
0answers
137 views

update the group audience field using rules

Is it possible to update a group's audience field using rules or actions ? I would like to add nodes/remove currently selected nodes from the list in groups audience. Would anyone know of a way to ...
1
vote
0answers
16 views

Rule that sends one email out at specific time each day with view content in it

I have 5 different views that show different metrics within blocks on the front of my website. I want a rule that can send this information to me by email each day at a certain time. How do I do this, ...
1
vote
0answers
18 views

Read opengraph property and use as field title

I have a simple site that generates an article content in the page. This content is a link preview of the article URL. My goal is when an article is created I want to use metatag property sitename as ...
1
vote
0answers
20 views

Rules replacement pattern for End Date

I have a rule set up to email the contents of an entity form. I am using replacement patterns to print out the submitted data. However, I cannot get the end date to print out. I have [entityform:...
1
vote
0answers
27 views

RulesAction to send notification for specific users after node has been created

The Background I'm using the module 'Permissions by Term' (https://www.drupal.org/project/permissions_by_term) to make some nodes only visible to users which are allowed to see the assigned term. ...
1
vote
0answers
58 views

Call REST GET request inside Rules Action

I created a custom Rules Action that calls a REST API. I can be able to display $entityId = $entity->id(); but when I try to use it concatenated in my $uri I am getting no result in $data. $uri = '...
1
vote
0answers
29 views

How to programmatically check whether field on form has changed in hook_form_alter

In rules you have the ability to check whether a field in a form has been changed by negating node-unchanged:field-xyz = 123. I want to check whether a field has changed programmatically with the $...
1
vote
0answers
32 views

Reaction rule raises TypeError

I have a working Drupal 8.3.7 installation and use the rules3.0alpha module. I add a reaction rule that is applied After saving new comment. That's all. Now, when I try to save a comment, I get an ...
1
vote
0answers
77 views

Apply a discount rule when calculating cart total?

I would like to apply a discount on cart items at check-out. The discount will be based on quantity of particular product type. What event can I use to calculate a discount during checkout? Here is ...
1
vote
0answers
44 views

How to ban a commentator's IP address with Rules?

When spammy comments appear on my website, I delete them and manually add the commentator's IP address to the banned list. However, it should be easier to Flag the comment with a new comment Flag Spam ...
1
vote
0answers
30 views

Running rules as a different user

Is there a way to have a rule run as a specific user instead of the person who triggers it? For instance I have a rule where, if an authenticated user posts a certain type of content it creates a ...
1
vote
0answers
152 views

How to use subtotal for calculating shipping

I am using Commerce 7.x-1.13 module on my website. I would like to calculate the shipping based on the order total. However, every time I refresh my checkout page, the shipping fee will be increased ...
1
vote
0answers
57 views

How to create a rule to redirect users to specific content according to their email domain?

I'm trying to setup the Rules module in D8, but I'm unable to do so. I want to redirect users, according to their email domain they used to register themselves on my website, to specific pages: ...
1
vote
0answers
80 views

How do I use the message module with the flag?

On Drupal 8 I installed the "Message" and "Flag" modules. I created a flag "Report content" and I want a message to be sent to the site administrator as soon as a content is reported. Messages will ...
1
vote
0answers
91 views

Token replace for commerce products in rules

I'm trying to create a rule for automatically generating a commerce products titles from all the values of products fields. After each values I need to add suffix like cm, W, kg, mm e.g. In order to ...
1
vote
0answers
116 views

Configure Node Access in Rules

I have a content management site where users can pay to view a node for a certain content type. To make it happen, I am thinking to leverage rules: when the user purchases a node to read, his access ...
1
vote
0answers
31 views

Time related token return “0”

Am using the Booking time slots module. The rules tokens that are related to calendar/time return "0" Examples of the token include: [booking:slot-time], [booking:hour-start] and[booking:min-start] ...
1
vote
0answers
190 views

Assign Taxonomy Term from Text Field

I am auto generating taxonomy terms basis of a text field with rules. I need to auto assign the newly generated taxonomy term to the node basis of the text field. I have tried the Rules Autotag as ...
1
vote
0answers
88 views

How can I alter rules action variable?

I have a custom Rules action, and it returns a value to an action variable. For it I use code below return array('array_added' => $item); How can I alter this variable further?