Home › Forums › Backend Issues (wp-admin) › Issue with getting data from Elementor form › Reply To: Issue with getting data from Elementor form
HI @samnymr
I’m not at all familiar with elementor, however, can you see if the below works:
<?php
add_action( 'elementor_pro/forms/new_record', function( $record, $handler ) {
//make sure its our form
$form_name = $record->get_form_settings( 'form_name' );
if ( 'Create New User' !== $form_name ) {
return;
}
$raw_fields = $record->get( 'fields' );
$fields = [];
$admin_email = $no_exists_value = get_option( 'admin_email' );
$to = $admin_email;
$subject = 'Test form submission data';
$message = 'Form data';
foreach ( $raw_fields as $id => $field ) {
$fields[ $id ] = $field['value'];
$message .= $field['value'];
}
$headers = 'From: My Name <[email protected]>' . "\r\n";
wp_mail( $to, $subject, $message, $headers );
}, 10, 2);
The idea being on form submission, it should email the site admin address a list of form data.
Check whether the company name is present.
If not, the data isn’t reaching the submission.
If it is, you can then look to see which part may then be failing.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
Accordions are a great way to group related information while allowing users to interactively show and hide content. In this video, Damon Cook goes in-depth on how to create an accessible accordion block using ACF PRO’s Repeater field.https://t.co/RXT0g25akN
— Advanced Custom Fields (@wp_acf) March 2, 2023
© 2023 Advanced Custom Fields.
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.