I need to code for a questionnaire and based on the answers provided by the user, I need to display the products to the user. I understand Webform will take care of the questionnaire part, but I cannot use those results to perform my further actions I believe. So any suggestions or other modules I should check out or any help is appreciated.

Comments

wombatbuddy’s picture

1. You can create a WebformHandler.
See the example in the 'webform_example_handler' submodule of the 'Webform' module.
Or see the article 'Create a Webform Handler that sends a notification to Slack'.

2. You can use the 'Rules' module.

3. You can implement the 'hook_ENTITY_TYPE_insert' or 'hook_ENTITY_TYPE_presave'
for the 'webform_submission' entity: 

function YOUR_MODULE_webform_submission_insert(WebformSubmissionInterface $webform_submission) {
  // Process a webform submission data.
}

function YOUR_MODULE_webform_submission_presave(WebformSubmissionInterface $webform_submission) {
  // Process a webform submission data.
}
pk027’s picture

Great. Thanks for the insight. It was very helpful