You are here

README.txt in Webform Rules 7

Same filename and directory in other branches
  1. 6 README.txt
This module provides a basic rules integration for webform.


-- REQUIREMENTS --

You need the following modules for a working feature:

 * Webform (http://drupal.org/project/webform)
 * Rules (http://drupal.org/project/rules)

optional:
 * Token (http://drupal.org/project/token)


-- INSTALLATION --

Copy the module files to you module directory and then enable it on the admin
modules page. After that you'll see a new event in the listing while creating
a new rule.


-- USAGE --

Using the submitted data in a rule is easy, as you can access it either via PHP
(requires core module "PHP Filter") or using tokens (after installing the
Token-module [http://drupal.org/project/token]).

PHP:
 Each rule reacting on an event thrown by "Webform Rules" gets 3 arguments to
 work with:
  * $user
     The user object of the acting user (the one, who submitted the webform).
  * $node
     The webform itself.
  * $data
     The submitted webform data and the submission id.
     To get the submission id, use <code><?php print $data['sid']; ?></code>.
     The components of the webform are stored using this structure:
     <code>array(
       '{form_key}' => array(
         'value' => {submitted value},
         'component' => {webform component},
       ),
     )</code>
     Given this structure, you can access the value of a component called
     "email" with
     <code><?php print $data['components']['email']['value'][0]; ?></code>.

     Warning:
      This is raw user input! Make sure to run this through check_plain() before
      using it.

     Note:
      The component value is always an array since the submission data is saved
      this way.

Token:
 There are 9 pre-defined tokens for the webform data:
  * [data:sid]
    Token to get the unique identifier of the submission.
  * [data:data]
    This one prints out all data submitted by the webform in the following
    format:
    {form_key}: {label}: {value}
  * [data:data-raw]
    This one does exactly the same as [data:data] with the difference to not
    clean up the values using check_plain().
  * [data:{component}-title]
    This is a dynamic token. "{component}" is a placeholder for the components
    form key (machine readable name). Example: your webform has a component with
    the form key "email". So you would write [data:email-title] to use the title
    (label) of this field.
  * [data:{component}-value]
    Same as [data:{component}-title], but it returns the value instead of the
    title.
  * [data:{component}-value-html]
    This one does exactly the same as [data:{component}-value] with the
    difference that its output will be rendered as html.
  * [data:{component}-value-raw]
    This one does exactly the same as [data:{component}-value] with the
    difference to not clean up the value using check_plain(). This is raw user
    input so take care if you use this somewhere else.
  * [data:{component}-display]
    Returns a combination of [data:{component}-title] and
    [data:{component}-value] (done by module Webform).
  * [data:{component}-display-html]
    This one does exactly the same as [data:{component}-display] with the
    difference that its output will be rendered as html.

Condition:
 Webform Rules adds a new condition to the rules configuration. With this
 condition you can tell rules to react only on one specific webform by selecting
 its title.

Actions:
 Webform Rules provides some additional actions to either open or close webforms
 or fetch a list of submissions for a webform.


-- AUTHOR --

Stefan Borchert
http://drupal.org/user/36942
http://www.undpaul.de

File

README.txt
View source
  1. This module provides a basic rules integration for webform.
  2. -- REQUIREMENTS --
  3. You need the following modules for a working feature:
  4. * Webform (http://drupal.org/project/webform)
  5. * Rules (http://drupal.org/project/rules)
  6. optional:
  7. * Token (http://drupal.org/project/token)
  8. -- INSTALLATION --
  9. Copy the module files to you module directory and then enable it on the admin
  10. modules page. After that you'll see a new event in the listing while creating
  11. a new rule.
  12. -- USAGE --
  13. Using the submitted data in a rule is easy, as you can access it either via PHP
  14. (requires core module "PHP Filter") or using tokens (after installing the
  15. Token-module [http://drupal.org/project/token]).
  16. PHP:
  17. Each rule reacting on an event thrown by "Webform Rules" gets 3 arguments to
  18. work with:
  19. * $user
  20. The user object of the acting user (the one, who submitted the webform).
  21. * $node
  22. The webform itself.
  23. * $data
  24. The submitted webform data and the submission id.
  25. To get the submission id, use .
  26. The components of the webform are stored using this structure:
  27. array(
  28. '{form_key}' => array(
  29. 'value' => {submitted value},
  30. 'component' => {webform component},
  31. ),
  32. )
  33. Given this structure, you can access the value of a component called
  34. "email" with
  35. .
  36. Warning:
  37. This is raw user input! Make sure to run this through check_plain() before
  38. using it.
  39. Note:
  40. The component value is always an array since the submission data is saved
  41. this way.
  42. Token:
  43. There are 9 pre-defined tokens for the webform data:
  44. * [data:sid]
  45. Token to get the unique identifier of the submission.
  46. * [data:data]
  47. This one prints out all data submitted by the webform in the following
  48. format:
  49. {form_key}: {label}: {value}
  50. * [data:data-raw]
  51. This one does exactly the same as [data:data] with the difference to not
  52. clean up the values using check_plain().
  53. * [data:{component}-title]
  54. This is a dynamic token. "{component}" is a placeholder for the components
  55. form key (machine readable name). Example: your webform has a component with
  56. the form key "email". So you would write [data:email-title] to use the title
  57. (label) of this field.
  58. * [data:{component}-value]
  59. Same as [data:{component}-title], but it returns the value instead of the
  60. title.
  61. * [data:{component}-value-html]
  62. This one does exactly the same as [data:{component}-value] with the
  63. difference that its output will be rendered as html.
  64. * [data:{component}-value-raw]
  65. This one does exactly the same as [data:{component}-value] with the
  66. difference to not clean up the value using check_plain(). This is raw user
  67. input so take care if you use this somewhere else.
  68. * [data:{component}-display]
  69. Returns a combination of [data:{component}-title] and
  70. [data:{component}-value] (done by module Webform).
  71. * [data:{component}-display-html]
  72. This one does exactly the same as [data:{component}-display] with the
  73. difference that its output will be rendered as html.
  74. Condition:
  75. Webform Rules adds a new condition to the rules configuration. With this
  76. condition you can tell rules to react only on one specific webform by selecting
  77. its title.
  78. Actions:
  79. Webform Rules provides some additional actions to either open or close webforms
  80. or fetch a list of submissions for a webform.
  81. -- AUTHOR --
  82. Stefan Borchert
  83. http://drupal.org/user/36942
  84. http://www.undpaul.de