This article explains how to use a string function to return only alphabetical characters and remove apostrophes from a username.
- Expression Language
- Custom Username Format
Follow the steps or video below:
To format a username like john.obrien@domain.com instead of john.o'brien@domain.com, use the following expression:
String.toLowerCase(user.firstName) + "." + String.toLowerCase(String.replace(user.lastName, "'", "")) + "@<domain>.com"
NOTE: Replace <domain> with the desired domain name.
