Hi,
That would be possible if you create your own custom “form action” instead of using the default email action.
You can make a copy of email.php in the actions folder and rename it.
1. Copy class from email.php
2. Change name, choose unique $type and $label
3. Create instance of that class and call hook method.
$action = new HTML_Forms\Actions\Webhook();
$action->hook();
Hope that helps. If you have any questions, please let us know!
Thank you for replying @lapzor
Could you point on some extra direction here?
Can I add this new class into my theme?
When you copy the Email.php file in the Actions folder in the Boxzilla plugin folder, you make a new file there, let’s say named MyOwnEmailAction.php
That is the file where you replace the class name / type / label.
And then of course write your own PHP code to email it to the field value.
Note that this is not something you can just copy / paste and figure out if you are not actually an experienced PHP programmer.
Hope that helps. If you have any questions, please let us know!
Thank you @lapzor. That goes a little out of my php knowledge. However, I managed to achieve what I intended using one of the code snippets I found in github:
add_filter( 'hf_form_markup', function( $markup ) {
$email = get_field('email');
if ($email) {
$markup .= '<input type="hidden" name="HIDDEN_EMAIL" value="' . $email . '" />';
return $markup;
}
});
This way I can get the value from the custom fields and pass it as a hidden input in the form. It is working without errors so far.
-
This reply was modified 7 years, 1 month ago by
marbaque. Reason: Added explanation
-
This reply was modified 7 years, 1 month ago by
marbaque.