Skip to content
Corex

EmailAnswer

Corex\Support\EmailAnswer · class · Core layer

What somebody typed where an email address was asked for, without it being changed into a different one. sanitize_email() does not refuse an address, it removes the characters it does not accept and returns what is left: sal,ma@example.com comes back as salma@example.com. Used ahead of validation, that turned a mistyped address into a different person’s valid one, and an answer with no address in it into an empty string no rule ever saw.

The address, when it is one WordPress would store exactly as typed; otherwise an empty string. For a caller that needs an address or nothing: a subscription, an account, a reply.

The answer for validation rules to judge. An address WordPress would leave alone is returned as typed; anything else is returned as plain text, so a rule can refuse it by name.