I want to link my feedback form's email address and Regex to validate the email address entered by an customer
Asked
Active
Viewed 169 times
0
-
Can you share some coding attempts? – Seyi Daniel Sep 21 '20 at 10:47
1 Answers
0
What you probably need is a validate
method. Inside your FormAction class you can define a validate_{slot_name}
method which will be automatically called after the slot is successfully extracted using your defined slot mappings.
Assuming your email slot is called email
your validate method name should be validate_email
and would look like this:
def validate_email(
self,
value: Text,
dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any],
) -> Dict[Text, Any]:
"""Validate email value."""
# Your regex validation logic...
Check this link to check an example of what you should return inside a validate_{slot_name}
method.

yk46
- 130
- 1
- 7