0

I am on a Drupal 7 website and I have a webform with multiple fields, one field is a selectbox with :

  • 1-10 employees
  • 10-20 employees
  • 20-30 empolyees
  • ...

Another one is an open textfield Postcode.

Webform offers the possibility to choose the recipients (e-mail TO) based on a component but not on multiple components.

For example, I want the mail to be sent to [email protected] if employees = 1-10 and Postcode = 75000 etc.. And one more thing, I want my client to be able to change and contribute these rules. So a solution with Webform Rules will be too difficult for them in my opinion. I hope to find a solution within the webform e-mail interface.

Have you any idea how is it possible to do that without building a new complete custom form and keep the power of Webform ?

Thanks.

2
  • Debug the js running at the browser to know what scripts takes long processing .. use chrome profiler or any similar tools. Commented Oct 15, 2017 at 20:06
  • I'm not sure it would help me in any way.
    – guilhom
    Commented Oct 16, 2017 at 8:21

1 Answer 1

1
+50

I suggest you try to avoid using simple textfield for the Postcode. Then you can use 2 dependent fields. The first field will be the select of employees number range. The second will be one of postcode selects, depending on the first choice. Then you can use the standard functionality: using select field key as the email.

If for a fixed employee number range you have individual emails for different postcode values then it is straitforward.

If not, still you can do it if all postcode values could be grouped into ranges, so that each range gets its own email (define select values for postcode ranges same as you did for employees number).

5
  • Sorry, I deleted my previous comment to add some details. So yes, if I use conditionnal fields, I can show different employees range, but on the emails settings, I can only choose one field for the "E-mail to".. And I have multiple fields with e-mails.
    – guilhom
    Commented Oct 16, 2017 at 9:04
  • Yes, this is conditional fields. You don't need any additional module, this functionality is included in the Webform module: there is a rather user-friendly interface on the sub-tab "Conditionals". Commented Oct 16, 2017 at 9:05
  • Example : Postcode: values (North / South) Employees range North : 1-10 ([email protected]) / 10-20 ([email protected]) Employees range South : 1-10 ([email protected]) / 10-20 ([email protected]). But on the Emails interface, I have to choose between Employees South/north, can't use both...
    – guilhom
    Commented Oct 16, 2017 at 9:07
  • Add two email sendings: one for Employees range North and the other one for South. Only one will be sent. Commented Oct 16, 2017 at 9:58
  • It seems to work with 2 e-mails configured. Thanks for your time, I'll wait a bit if someone has a better answer, if not, the bounty is yours.
    – guilhom
    Commented Oct 16, 2017 at 12:35

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.