Email Validation Function

Determine if a chat user submits a valid email address by using the following app action cards in a guided conversation. 

Input: string (chat user input)

Returns: boolean (true for valid email, false for invalid)


To use:

1. In the left hand panel of your guided conversation, select + Add Application. This will bring up a search menu.

2. Search for and select Miscellaneous Functions. You will now be able to use the Email Validation function.

In the Guided Conversation:

1. Once you've asked a user to input their email or you have a variable you'd like to check, you can pass the value to the Email Validation function. For further details on working with guided conversations, go to Working with guided conversations.

Example:

2. You can then use a logic card to check if the output of that function — {{valid_email}} — is "True" or "False" (Note: "True" / "False" must be capitalized, and the variable name between the curly braces must be lowercase)

The logic card:

3. Actions upon successful validation should be added below the "If valid email" path, and actions following an unsuccessful validation can be added below the "Fallback" path. Tip: if validation fails, you can use a "skip-to" card to route the user back to the card requesting the user to put in their email address.

Fallback path example:


Additional Resources

For help with Guided Conversations or any of the above topics, please get in touch with our support team at support@capacity.com.


Was this article helpful?