Skip Navigation

[Resolved] Email form to Customer when submitting

This thread is resolved. Here is a description of the problem and solution.

Problem: I would like to send an automatic email notification to the Customer Email, but the placeholder does not seem to work in the recipient settings of my automatic notification.

Solution: Placeholders like %%CUSTOMER_EMAIL%% cannot be used outside of the subject and message areas of the automatic email notification. To send a notification to a specific email, you can insert an email custom field in the Form and choose that field as the recipient, or use a generic field to hold a User ID, or set up some custom implementation using the Forms API to programmatically select a recipient.

This support ticket is created 2 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Our next available supporter will start replying to tickets in about 0.13 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 11 replies, has 2 voices.

Last updated by philipC-4 2 years, 8 months ago.

Assisted by: Christian Cox.

Author
Posts
#2121247

Hello Christian,

We have a post form named DIY Structural Systems that will be submitted to the "customer email address" once it has been filled out. We have the email notification set to "Send To: %%CUSTOMER_EMAIL%%" when submitted.

Everything seems to function but the form does not show up in the email inbox.

Please advise.

Is there any documentation that you are following? https://toolset.com/course-lesson/send-notifications-when-someone-submits-the-form/

What is the link to your site?
hidden link

Form being submitted:
hidden link

Please let me know if I need to provide login credentials.

#2121439

Everything seems to function but the form does not show up in the email inbox.
Hello, Forms placeholders like %%CUSTOMER_EMAIL%% do not work in the recipients fields, unfortunately. Placeholders are intended for use in the Subject and Body areas. I can help you send an email notification to an email address captured in the Form, if that's what you had in mind.
- I assume you mean you want to send the notification to the email address provided in the form field "Email this form to:", is that right?
- If that is right, is "Email this form to: " a generic email field that you created by dragging a generic Email field into the Form builder? Or is this input field a Toolset Types email custom field in a Custom Field Group associated with the Property Listing post type? Or did you add this input field with basic HTML in an HTML block in the form editor?
- If you created this input field with basic HTML in an HTML block in the form editor, please delete that input HTML and replace it with a generic email field by dragging one into the form builder. Generic fields are not automatically saved in the database anywhere, and do not appear in the custom field editor area in the post editor screens. If you need to store this email for future use outside of this notification, you can create a Types email field instead and insert that field in the Form builder, or you can use a custom code snippet to save the generic field value somewhere else.
- What is the slug of the email field? If it is a generic field and no slug exists yet, please add a slug and let me know the slug you chose.

#2121469
Screen Shot 2021-07-21 at 2.54.43 PM.png

Hi Christian, my apologies. I forgot to remove the generic email field that was in place (it was from a previous test we attempted). The form is now the way it's supposed to be. All that we would like for it to do is for the form to be emailed to the "billing email" when it's submitted. If this is not possible, let me know if we need to go the route you described. Thanks in advance for your amazing customer support.

#2121575

Okay next I would try these troubleshooting steps if the emails are not delivered as expected:
- Install the WP Mail Logging plugin. This plugin will help you determine if the notification is being sent to wp_mail() or not, and help determine why it might be failing.
- Click the test email button below the notification editor and try to send a test message to a known email address.
when the Form is submitted. If the notification appears in the logs, check the details and see if anything looks suspicious, like an error message or a blank recipient.
- Check the checkbox to also send the notification to a specific email address. Add the address of another email account you have access to, something on a different email provider if possible.
- Check the spam /junk folders of any email addresses you're sending to, sometimes test messages end up in spam.

#2121603

Hey Christian, I followed your steps and when I went to do a test submission, I noticed the form lost all of its styling and we are actually missing some information. Other than adjusting the email notifications and installing the WP Mail Logging plugin the "form editor" was never touched. Should we do a backup restore at this point?

#2122373

Should we do a backup restore at this point?
I would try to determine why things are missing first. If the problem is a conflict with another theme or plugin, restoring may not solve the problem effectively. Can you tell me more about what is missing? Was some of the content in the Form builder lost, like a custom HTML block that was there is no longer there? Or a CSS class was applied to some content, but no longer exists in the form builder? Or maybe you added some custom CSS in a CSS editor but those styles are not present now?

Please provide more technical details about the missing item(s) and we can go from there.

#2122387
Screen Shot 2021-07-22 at 8.47.22 AM.png

Good morning Christian,

Yes, Here is what was lost.
-Custom HTML Content Block with a line break
-Conditional Group
-Add Media Block (4 of this per category)

I attached an old screenshot and highlighted in pink what is missing

#2122457

Okay based on that information it sounds like content is missing from the Form builder. Reverting to a previous backup might restore this Form's content, but it could also mean you lose some progress you made in other areas. So I would consider how much effort it will take to recreate the missing pieces of this form. If it would take less than an hour, it might make the most sense to just recreate the missing pieces.

If it's considerably more complex, I would create a backup of the current site first, so you can have another restore point. Then revert the site using another less recent backup where the Form was still working as expected. If the Form is restored successfully and no other content was impacted, you're all set. On the other hand, if restoring to the previous state deleted progress you made in other areas since the restored backup was generated, now you have another problem to solve.

One way to get around this is you can export all the Post Forms in the reverted state using the Toolset > Export/Import tool. Then restore the site once again using the most recent backup. That should fix the other missing progress, but reintroduce the problem in this Form. You can now restore this Form using the exported Forms content from the previous site state.

How you import the Forms content depends on the status of the other Post Forms you exported, and whether or not you will overwrite any important changes in those Forms. If so, it's probably best to edit the export document in a text editor and delete information from all the other Forms, leaving only the information about this one Form you want to restore. The file format is XML, so it would require some understanding of code to make those changes, but the idea is that after this file modification, you would import the Forms content and only overwrite the one Form that has missing information.

So depending on how old is this backup you plan to restore, the process could be more or less complex, and if the changes in the Form are going to take less than an hour or so you're probably going to be better off just manually making those changes in the current site and avoiding reverting the site. If the backup is pretty old, there could be many changes lost by the backup restoration.

#2122829

Hello Christian, I wanted to give you an update. We have restored to a previous backup, all data was restored except the Calculation custom code you helped us with, in the previous support ticket. I will respond there as we are having an issue. Once that is resolved, we will dive into this topic again.

Thank you for your patience.

#2123423

Good morning Christian, we were able to restore the custom code and we are back in business!

Back to this topic again. It appears that the form is submitting when I checked the checkbox to also send the notification to a specific email address. It just takes a little bit to receive it. So to cover our selves we would like to have an "Email this form to:" field on the page where you are composing the post or the results page. Is this possible? We created a "custom field" and named it email-this-form. Let me know if we need to create a "generic field" instead.

On this page:
hidden link

or this page:
hidden link

#2125281

So to cover our selves we would like to have an "Email this form to:" field on the page where you are composing the post or the results page. Is this possible? We created a "custom field" and named it email-this-form. Let me know if we need to create a "generic field" instead.
A custom field should be fine. After you create the field, you can insert it in the Form builder. In the email notification recipient settings, you can choose the option "Send notification to an email specified in an email field included in the form:" and select the new email-this-form field once it has been inserted in the Form builder. That should automatically send the notification to the email address submitted in the custom field.

#2125535

My issue is resolved now. Thank you so much Christian for your continued support.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.