We are having problems with many customers because they mistype their email and then, of course, they don't receive the booking confirmation. How could we validate the email please? Is there a way to validate this field somehow? Maybe by typing it twice and verifying that both text boxes have the same value? Any other advice?
Email verification is not possible with Amelia, but there's a workaround you can apply that will check the email. Here's what you need to do: (Please note that this only works for an old version of Booking Form)
Go to Amelia/Customize/Custom Fields, and create a "Text" custom field, with the "Required" check-box enabled and apply it to all services:
Then go to Amelia/Notifications and click on "</>Show Email Placeholders" to see the ID of that custom field:
Then, on the booking page, add a custom script:
<script>
window.afterConfirmBooking = function(appointment, bookable, provider, location) { if (appointment.bookings[0].customer.email !== appointment.bookings[0].customFields[14].value) { var alertElement = document.getElementsByClassName('el-alert__title')[0]; alertElement.innerHTML = 'Emails do not match'; var alertBlock = document.getElementsByClassName('am-payment-error')[0]; alertBlock.children[0].style.display = 'flex'; alertBlock.scrollIntoView({ behavior: 'smooth', block: 'start'}); throw "Abort"; }
}
</script>
Just make sure to enter the correct Custom field ID in:
customFields[14].value
This will not allow the customer to proceed with the booking if the email in the email field and the email in the custom field do not match:
For the new booking form, you can place a custom validation script
<script> window.ameliaActions = { customValidation: function (success = null, error = null, data) { console.log('customValidation HOOK') console.log('------------') //you can check existing rules here console.log(data.rules) const customValidator = (rule, value, callback) => { if (!value.includes('@health-check.at')) { callback(new Error()) } else { callback() } } // this example is for email input field data.rules.email.push({required: true, message: 'CUSTOM MESSAGE', validator: customValidator, trigger: 'submit'}) }, } </script>
Custom code needs to be applied to the page where the booking form is. Depending on what you're using (Gutenberg blocks, or some page builder), adding the CSS or JS can be done in a few different ways.
If you need help with adding custom JS to the page, please take a look at this article.
Taking into account your advise from another ticket, I'm switching from 1.0 to 2.0 form, but now I need to change this workaround, and the version for the new form is not working as spected :(
Could you clarify the code for the new form please? What is this code doing? Just checking a fixed rule to know if the email match with '@health-check.at'? Can I compare it with another field like the code for the form 1.0 please?
Yes, that's correct. This custom script can be used in cases if you want to have validation with the specific email, in this case @health-check.at. In Customize section, if the option "mandatory" is enabled for email field, then the customer would need to enter at least some type of email (in correct email format) so Amelia can register. This script is made in case if want to have a validation of a custom form (or email).
Thanks Stefan, but what I need is to ensure that the customer enter a valid Email (not just in term of format), but sometimes the customer don't puts his mail correctly, so what I need is to force the customer to put the mail in two edit, and compare that these two edits contain the same value (check the example you have provided me for Form 1.0 which works correctly).
You would need to add the custom field, similar to v1.0 and then change the custom field id in the script above. The error will be visible if the email is not the same as the custom field, but you need to make sure that the custom field is marked as required.
You've added the script in "shortcode" module. It needs to be added on page, not the shortcode module. The easiest way is to use WP code plugin. You can follow the instructions on this link.
Hi Team,
We are having problems with many customers because they mistype their email and then, of course, they don't receive the booking confirmation.
How could we validate the email please? Is there a way to validate this field somehow? Maybe by typing it twice and verifying that both text boxes have the same value? Any other advice?
Thanks as usual...
Lisbel.
Hello ORION PREMIER SL,
Thanks for reaching out to us.
Email verification is not possible with Amelia, but there's a workaround you can apply that will check the email. Here's what you need to do: (Please note that this only works for an old version of Booking Form)
Go to Amelia/Customize/Custom Fields, and create a "Text" custom field, with the "Required" check-box enabled and apply it to all services:
Then go to Amelia/Notifications and click on "</>Show Email Placeholders" to see the ID of that custom field:
Then, on the booking page, add a custom script:
Just make sure to enter the correct Custom field ID in:
This will not allow the customer to proceed with the booking if the email in the email field and the email in the custom field do not match:
For the new booking form, you can place a custom validation script
Custom code needs to be applied to the page where the booking form is. Depending on what you're using (Gutenberg blocks, or some page builder), adding the CSS or JS can be done in a few different ways.
If you need help with adding custom JS to the page, please take a look at this article.
I hope it helps. Please, let us know if it works.
Kind Regards,
Stefan Petrov
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps, and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
You are a genius, I just applied this workaround and it works perfectly!
Thank you so much...
Lisbel.
Hello Lisbel,
You are most welcome, i hope you are finding Amelia useful.
If you have any other questions, please open a new ticket and we will gladly help you there.
Have a nice day!
Kind Regards,
Stefan Petrov
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps, and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hi Stefan,
Taking into account your advise from another ticket, I'm switching from 1.0 to 2.0 form, but now I need to change this workaround, and the version for the new form is not working as spected :(
Could you clarify the code for the new form please? What is this code doing? Just checking a fixed rule to know if the email match with '@health-check.at'? Can I compare it with another field like the code for the form 1.0 please?
Thanks in advance for your help again.
Hello Lisbel,
Yes, that's correct. This custom script can be used in cases if you want to have validation with the specific email, in this case @health-check.at. In Customize section, if the option "mandatory" is enabled for email field, then the customer would need to enter at least some type of email (in correct email format) so Amelia can register. This script is made in case if want to have a validation of a custom form (or email).
Kind Regards,
Stefan Petrov
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps, and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Thanks Stefan, but what I need is to ensure that the customer enter a valid Email (not just in term of format), but sometimes the customer don't puts his mail correctly, so what I need is to force the customer to put the mail in two edit, and compare that these two edits contain the same value (check the example you have provided me for Form 1.0 which works correctly).
Thanks again! :)
Hello Lisbel,
This is the closest workaround for 2.0 similar to v1
So, there is this script that you can add to the page
You would need to add the custom field, similar to v1.0 and then change the custom field id in the script above. The error will be visible if the email is not the same as the custom field, but you need to make sure that the custom field is marked as required.
Please, let me know if it works.
Kind Regards,
Stefan Petrov
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps, and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Thanks Stefan.
I put exactly your code, in the page where I have the booking shorcode, just changing the customFieldId, because in my case it's 1.
But I don't get any error message, the process continue normally :(
And after that, directly to the paiment page in Woocomerce without restrictions :(
Could you kindly check the code please?
Thanks once more time for your help.
Hello Lisbel,
You've added the script in "shortcode" module. It needs to be added on page, not the shortcode module. The easiest way is to use WP code plugin. You can follow the instructions on this link.
Kind Regards,
Stefan Petrov
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps, and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Your help is really appreciated Stefan, this screenshot is just to share a big thank you with you:
Hello Lisbel,
You are welcome! You just confirmed the workaround for email verification with new v2 booking form
Of course, in case if you have any other questions, feel free to reach out to us and we will kindly assist.
Have a nice day!
Kind Regards,
Stefan Petrov
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps, and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables