Blog·Craft·

The typo knew where it was going

didyoumean on /email returns the full suggested address when the host is a known misspelling, and null when it is not.

gmal.com is not a mailbox. It is a fat finger.

GET /email/tom.f@gmal.com
{
  "email": "tom.f@gmal.com",
  "didyoumean": "tom.f@gmail.com",
  "valid": true,
  "domain": "gmal.com"
}

didyoumean sits on core, right next to email. When the host is a known misspelling of a real mail host, the field is the full suggested address, local part unchanged. When the host is already right, or not in the list, it is null. Ties stay out. A typo that is itself a real host stays out. No fuzzy matching across the whole internet.

The local part is theirs

tmo.f@gmal.com still comes back tmo.f@gmail.com. The field rewrites the host it knows, never the name they typed. A signup form can offer the suggestion without inventing a person.

Try it

Call /email with tom.f@gmal.com and read didyoumean. They meant gmail. The field already said so.