I have run into a wall trying to find a solution to this problem and am hopeful someone here may have some feedback or ideas. (I'm on Drupal 8 btw)
A department in my organization wants a form with a multi-selection (checkboxes) field with 10 different options. They have text paragraphs that correspond with each option that they want to email to the user, but only if they select those options. Right now the only ways I can think of to approach this is to:
- create separate emails for each individual service, so they would receive as many different emails as they select services (which is not ideal because we don't want to blow up their inbox)
- use conditional logic on the emails based on user selection (which is not feasible because 10 options would yield 1023 different combinations)
What I'm wondering is: is there a way to have a Drupal webform pull content from a provided source and insert that into the email it sends based on what a user selects?
For example, let's say this checkboxes field lists different subject areas where a student needs assistance: math, science, art, history, geography, french. If the student selects math, science and art, I'd like the email to contain the corresponding text paragraphs for each of those subjects and none of the others. Similarly, if they select history and geography, or only french, the email would contain those respective text paragraphs. Is this possible to do somehow? Or is there another way to approach this? I would be very grateful for any insight or help!
I see the webform module has handlers (action, debug, remote post, and settings) but I'm not entirely sure if these can do what I'm trying to do, and if so, how they work?
I did find this post: How to conditionally change email content from Webform submissions which asks a very similar question, though I don't understand the provided suggestions.