0

I have a Drupal 8 website with an application form built with Webform. I would like to be able to auto create a user when the webform is submitted using details from the webform, so the person filling in the application can log-in and check the status of their application. I've seen several options online but all are for Drupal 7 and the modules used are not available for Drupal 8.

Any ideas?

1

1 Answer 1

1

You can write your own WebformHandler to do so. Just extend WebformHandlerBase and write your code into the postSave() function. Here is a little example: https://gist.github.com/mharmuth/0ab021d5b65e4cab7c6efec951fc59e9

This class has to be stored in your custom module in the directory your_custom_module/src/Plugin/WebformHanlder/CreateUserHandler.php

After creating this handler, you will be able to add it in your webform under "Email/Handlers".

Hope this helps ;)

0

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.