Rules WebForm Submitted adds a Condition to Rules that allows you to test to see if a specific webform node has been submitted by the current user. This is useful for restricting some content on your site to users who have completed a webform. For example, you may want to "require registration" of certain content before making it available to collect sales leads, etc.
Note: This module is similar to Webform Rules in that it supports integration between Webform and Rules, but different in that Webform Rules supports the Event "Webform Submitted", while Rules Webform Submitted provides a Condition which is typically triggered by a Node Event.
To set up this functionality,
- Download and enable Rules, Webform, and Rules WebForm Submitted (this module)
- Create a new Rule named "Require Registration To View Content" (for example)
- Add the Node Event "Content is about to be viewed".
- Add a condition for the type of node you want to restrict access on.
- Add the condition "Webform has been submitted" and choose the Webform that you want the user to fill out before viewing content.
- Click the "Negate" option to cause the rule to trigger if the webform has NOT been submitted
- Save the "Webform has been submitted" condition.
- Click Add an action
- Choose Page redirect for the action type and click Next.
- Under "To" enter the URL Alias or Path to the webform to authenticate against
- After the "?" enter destination=node/[node:nid] to cause the webform to redirect to the target content node after being submitted.
This will have the effect of displaying a webform for content for which the user has not submitted the webform, and will forward to the content after submitting the webform.
Project sponsored TMA+Peritus