2

I am using webform in Drupal 7 and have a case where I need to send an e-mail only if a certain select field has an option selected. I have installed Rules and Webform rules but am a bit stuck on how to get this going.

In my webform I have the field called type (which is nested in a fieldset called shipping). My 3 options in the field are Ground, Air, Ocean. What I would like to do is send an email (using Rules due to a pdf that is attached to the email) only if the option selected is Ground.

Is this possible with Drupal 7 and rules / webform rules?

2
  • in your rule, add a condition, entity has field, then you can access your field value and set your desired condition. iF you have several conditions, i recomendo you to use 'rules conditional module'
    – pinueve
    Feb 14, 2020 at 18:53
  • Does this answer your question? Creating Email Sending Rules in WebForm in Drupal 7
    – Nikit
    Feb 15, 2020 at 1:13

1 Answer 1

1

I would use a technique similar to what is described in my answer to "How can I compare data comparison with values submitted in a webform?". For short:

  • Add an extra Rules Action to Add a variable, with a value assigned to it equal to your Webform data you want to use (and with an appropriate data type). You'd need 1 such variable for each Webform component for which you want to access its Webform data.
  • In your subsequent Rules Actions you can refer to the value of these variables you just added (that's the clue!).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.