I need to set an auto response message on a Webform 7.x-3.19. I understand that I need to add a script which is going to do the job. My question is which php file should I edit to do so?
1 Answer
I don't have the exact answer to your question but I can give you some advices to how you can do.
First option, UI way, You can try the "Rules" Module with "Webform Rules" Module. It gives you the ability to do some operations on given context. I don't know that module, but it seems to be the easiest solution.
Second option, Dev way, you can manually hook your webform and add php code. You have to implement the "hook_form_FORM_ID_alter" hook You can retrieve webform form_id by following this answer of this post. In your hook implementation, add your custom submit function like the following snippet :
function YOUR_MODULE_form_FORM_ID_alter(&$form, &$form_state, $form_id) {
if(isset($form['#submit'])){
$form['#submit'][] = 'your_custom_function';
}
else{
$form['#submit'] = array('your_custom_function');
}
}
Some usefull links :