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

Context
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).

Example
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.

alias-first-part-of-email.png

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

Comments

0 comments

Please sign in to leave a comment.