Okay so i have disabled that third party plugin and now doing with CF7 Filters.
here is my code.
add_filter('wpcf7_mail_components','my_custom_mail', 10,2);
function my_custom_mail($mail_component, $contact_form){
$domain_data = do_shortcode( '[g4whostingdata]' );
if($wpcf7->id() == 6){
$mail_component['subject']; //email subject
$mail_component['sender']; //sender field (from)
$mail_component['body']; //email body
$mail_component['recipient']; //email recipient (to)
$mail_component['additional_headers']; //email headers, cc:, bcc:, reply-to:
$mail_component['attachments']; //file attachments if any
$key_values = array();
$tags = $contact_form->scan_form_tags(); //get your form tags
foreach($tags as $tag){
$field_name = $tag['name'];
if(isset($_POST[$field_name]) && !empty($_POST[$field_name])){
//get all the submitted fields form your form
$key_values[$field_name] = $_POST[$field_name];
}
}
$body = "Dear \n"
. "First Name: {$key_values['first-name']} \n"
. "Last name: {$key_values['last-name']} \n"
. "Email: {$key_values['your-email']} \n"
. "Domain Data : {$domain_data} \n";
$mail_component['body'] = $body;
}
return $mail_component;
}
I have set FORM ID but its showing Internal server errors and form is not submitted. could you please advice.
Thanks