Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- { "rules_validate_a_component_of_a_submitted_webform" : {
- "LABEL" : "Validate a component of a submitted webform",
- "PLUGIN" : "reaction rule",
- "OWNER" : "rules",
- "REQUIRES" : [ "rules", "rules_conditional", "webform_rules" ],
- "ON" : { "webform_rules_submit" : [] },
- "IF" : [
- { "NOT user_has_role" : { "account" : [ "user" ], "roles" : { "value" : { "2" : "2" } } } }
- ],
- "DO" : [
- { "drupal_message" : { "message" : "The webform component submitted by [data:contact_us_first_name-value] (= [data:contact_us_first_name-title]) [data:contact_us_last_name-value] (= [data:contact_us_last_name-title]) contains a field labeled u0022[data:contact_us_subject-title]u0022 which has value u0022[data:contact_us_subject-value]u0022 and another field u0022[data:contact_us_message-title]u0022 which has value u0022[data:contact_us_message-value-raw]u0022." } },
- { "variable_add" : {
- "USING" : { "type" : "text", "value" : "[data:contact_us_message-value-raw]" },
- "PROVIDE" : { "variable_added" : { "submitted_form_component_value" : "Submitted form component value" } }
- }
- },
- { "CONDITIONAL" : [
- {
- "IF" : { "text_matches" : { "text" : [ "submitted-form-component-value" ], "match" : "mail.ru" } },
- "DO" : [
- { "drupal_message" : {
- "message" : "Stop and listen! ... One of the form components of the form you just submitted (= u0022[submitted-form-component-value:value]u0022), contains some value that is not allowed around here ...",
- "type" : "error"
- }
- }
- ]
- }
- ]
- }
- ]
- }
- }
Add Comment
Please, Sign In to add comment