How do I alias only the first part of an email address?

If you would like to keep a valid email address but only want to redact the first part of the email address, then you'll need to set a Regular Expression (RegExp).

Please see the example route below using RegExp ^(?<token>[^@]+) to handle aliasing the first part of the email address. You could simply use ^[^@]+, but ^(?<token>[^@]+) is more readable and reminds you that you are aliasing the first part of the email.

NOTE: Depending on the payload that is being sent, you'll need to make sure that you don't accidentally alias other values, so make sure you test a few different use cases to make sure the alias is not being applied to other values.


Was this article helpful?
0 out of 0 found this helpful



Please sign in to leave a comment.