Validation to prevent entry from certain mail providers
Hi, How would i prevent certain mail providers from being input in a field. Examples of mail providers i don’t want to accept: - @example.com - @example2.com - @example3.com The blocked providers can change and i would like to manage them from within the app instead of the domain model. What setup would you suggest?
I am not sure what you mean by wanting to manage these domains within the app instead of the domain model, but here is how I would do this
Create an entity to contain blocked email domains
Create Overview and Edit pages for this entity
Make sure these pages are accessible in your app
Create a validation microflow for email address that ensures that a given email address does not contain any of the blocked domains like this:
create a String variable that grabs the email domain using the Substring function
retrieve from the BlockedDomains entity where domain name contains the email domain you just isolated (use the Xpath contains function)
if the retrieved list is not empty, reset the value of the passed in attribute and display a message to the user
Use this microflow as an on change event for any email address text boxes on pages in your app
Then, when you start your app, you can enter all of the blocked domains. As you want to block additional domains, just add them to the BlockedDomains entity.