Let's create observer function for WebForms that dumps submitted result into XML file.
We will be creating new extension called MageMe_WebFormsProcessResult.
This file holds information for composer script
This file registers module in the Magento system. The module is not visible without it.
This file holds basic description of our module. We need to set the sequence so that the module is loaded after the main WebForms extension.
This file registers our event handler function.
Here we define our model of the event observer class. It has some basic members to work with stores, system messages and logging.
$destinationFolder - variable that sets folder where result is being stored. We will be creating files in pub/media/webforms/xml folder.
$filename - is complete path to the file. For example pub/media/webforms/xml/123.xml.
Make sure pub/media folder is writable.
After the module is ready, please run following console commands:
Thats it! Feel free to modify this extension, experiment and add required post processing functionality to WebForms.
You can download sources here.