0

I'm using Drupal 7 and CiviCRM 4.7.3. I've built a Drupal webform and I want a user to be able to submit the form and get an email based on one of the options selected on the form. So far that part works fine if I send an email to the logged in Drupal user.

I'm having an issue sending an email to an anonymous user based on the value of the email field within the form. I tried using the following token (in the 'To' field in the Drupal rule):

[submission:values:civicrm_1_contact_1_fieldset_fieldset:civicrm_1_contact_1_email_email]

But that didn't work. I also tried to use PHP evaluation by using:

<?php print $form['submitted']['civicrm_1_contact_1_fieldset_fieldset']['civicrm_1_contact_1_email_email']['value'][0]; ?>

But that didn't work either.

I also added the token in the body of the email and changed the 'To' field to send to the logged in user. That email went through but where the token was in the body of the email was blank, this is telling me I have something wrong with the way my token is set up.

Can anyone offer any suggestions as to what I might be able to do?

1 Answer 1

3

I always use the Webform -> E-mails tab for this -> and then I can pick any Component to send an Email - in the example below I want to send an Email to the address that a user typed into the Email field.

enter image description here

2
  • 2
    Just a short addendum to Karin's answer - spinsheet wrote "get an email based on one of the options selected on the form" - check out the Conditionals tab and choices for setting webform conditions, and create something like 'send an e-mail to Email address entered on the form if value entered for component X = Y ). Aug 3, 2016 at 3:03
  • Exactly - good example! Jan 15, 2017 at 16:44

Your Answer

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

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