Kedar Joshi
Kedar Joshi

Reputation: 1462

Drupal 7: Webform: Send Emails Conditionally?

Is there any way to put a condition for sending emails?

For example: on my webform, I want to send email out only when current user = 'xyz' ?

I searched a lot but could not find a way to send email conditionally..

Upvotes: 2

Views: 6299

Answers (1)

fotuzlab
fotuzlab

Reputation: 1456

Webform Rules is what you are looking for.

Other option is to do it programatically. Check the second answer here.

EDIT:

Event:

  1. After a webform has been submitted

Condition:

  1. Select data comparison
  2. Click on the field, a dropdown will appear
  3. Select Use:...(User, who submitted the webform)
  4. This will open up a new dropdown. Select the data you want to match. In your case, it will be user:name
  5. Click continue. Configure "equals", "Data value" = XYZ.

Action:

  1. Send Email.

Upvotes: 3

Related Questions