-
-
Save mikka23/990f8c7b0a1d1365eb4ed77e1f40e937 to your computer and use it in GitHub Desktop.
Send a reply
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Action to handle Fusion Form Data. | |
add_action( 'fusion_form_submission_data', 'fusion_handle_form_data', 10, 2 ); | |
function fusion_handle_form_data( $data, $id ) { | |
/* IMPORTANT: Replace email_address with your field name. */ | |
$email = $data['data']['email_address']; | |
/** | |
* | |
* You can get data of any field same way by replacing key value in array -> $data['data']['FIELD_NAME'] | |
* | |
*/ | |
// Send an email. Basic usage example. | |
wp_mail( $email, 'Avada Enquiry Confirmation', 'Thank you for your enquiry, we will get back to you shortly.' ); | |
} |
Thanks for sharing this!
Novice here, but I wonder if possible to take it a step further and define two things:
A) Which form the auto reply is coming from ie have a different message for a few forms and B) show a custom FROM name ie not Wordpress
Any help truly appreciated
Lesley
Hi Lesley. The code is no longer needed. In 7.7 the ability to set your own emails (and have multiple) was added. So you can add auto responder emails to each form via the builder now.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice , thanks for sharing !
I was trying to use the same function but instead of wp_mail I used wp_redirect to pass the data as URL parameters as follows
$email = $data['data']['email_address'];
$WhatsApp_url = "https://api.whatsapp.com/send/?phone=#######&text=" + 'email:' + $email;
exit( wp_redirect( $WhatsApp_url));
But Im getting error ! could you please help ?
"There was an error trying to send your message. Please try again later."