I have created a simple contact form, however, I can’t get the form to send an email to the form submitter. I’m using the ‘Email Action’, with the ‘to’ ‘email’ = {{ form.data({“key”:“email_address”}) }}
I use FluentSMTP and the FluentSMTP email log shows the ‘to’ email field is empty on send (fails to send). It works if I insert a email, like joe@test.com, directly into the email field.
I have another ‘Email Action’ for admin notice and this works correctly - with all submitter fields showing within the email subject and body. The form submissions also show all correct fields.
Also, if I put the form data shortcode for ‘first_name’ into the ‘to’ ‘Name’ field, it shows as the raw shortcode, not the name, when emailed.
Here is my setup
Quick update.
I tested all the following shortcode possibilities, but nothing worked.
- {{ form.data({“key”:“email”}) }}
- {{dc:form:data key=“email”}}
- {{email}}
- {{ form.data({“key”:“email”}) }}
- {{ email }}
The form is a component, I turned on CS Form ‘Advanced mode’, I’m using the latest X Pro theme, Starter Stack, Twig enabled, HTML Storage on. Key plugins include FluentSMTP, SG Speed Optimizer, SG Security Optimizer (and others).
There seems to be a breakdown in the form fields working for the email and contact name in the Email Action element. I got around it by using a PHP Action element with the code:
// 1. Assign variables from the form data $to_email = $formData['email'] ?? ''; $first_name = $formData['first_name'] ?? 'Customer'; $message_body = $formData['message'] ?? ''; $site_title = get_bloginfo('name'); // This gets the global site title
// 2. Validation: Only send if the email field is not empty and valid if ( !empty($to_email) && filter_var($to_email, FILTER_VALIDATE_EMAIL) ) {
// 3. Updated Subject Line $subject = "We have received your message [" . $site_title . " contact form]";
// 4. Construct the HTML Content $content = "Hi " . htmlspecialchars($first_name) . ",<br><br>"; $content .= "Thank you for your message. We will respond as soon as possible.<br>"; $content .= "As a reminder, here is your message:<br>"; $content .= "---<br>"; $content .= "<i>" . nl2br(htmlspecialchars($message_body)) . "</i><br>"; $content .= "---<br><br>"; $content .= "Kind Regards,<br>The Innovatek Team";
// 5. Set Headers $headers = array( 'Content-Type: text/html; charset=UTF-8', 'From: Innovatek <email@email.com>' );
// 6. Fire the email wp_mail($to_email, $subject, $content, $headers);}
Hello @innovatek,
Thanks for writing to us.
In order to help you with your concerns, we need to check your settings. Please share the admin login details. In the meantime, I suggest you troubleshoot a few of the common issues before we investigate your settings. Please share your details in a secure note. Please provide the following details
- WordPress Login URL
- Admin-level username and password
- Exact page URL
You can find the Secure Note button at the bottom of your posts
Thanks
We’ll get that fixed in the next Forms point release. We originally had To as a singular field so we had some wires crossed. Thanks for sending this our way.

