Introducing email-to-name.js

Turning email addresses into meaningful data

Tait Brown
3 min readSep 4, 2018

A user’s digital footprint can reveal a lot about them. Their IP address might provide the location of their nearest internet exchange, while an SSO provider like Google could reveal their full name and so much more. But even a simple email address can help us get to know our users a little more.

One outlandishly expensive way of deriving information from an email address is by the use of an identity resolution services. They maintain enormous databases of user identities and charge handsomely for the privilege. FullContact provides one such service, with a business plan starting at $499/mo. That could be a worthwhile spend if you want to know absolutely everything there is to know about your audience, but what if you want substantially less information for simple needs like personalisation?

Email-to-name is a tiny script that attempts to derive a name, you guessed it, from an email address. It relies on a series of common patterns we creatures of habit often follow when deciding on an email address. It attempts to reverse engineer a useable name or nickname with a series of regexes. I created this because surprisingly, this didn’t exist anywhere online.

Email Addresses Often Follow Rules

Enterprise IT policies are nothing if not predictable. The most prevalent email address format you have most likely come across would be some form of firstname.lastname@company.com. The IT department might even get a little bit creative from time to time and simply use a first initial (think flastname@company.com) and use numbers to resolve clashes.

Personal Domain Patterns Exist Too

It is probable the more technical among your audience run their own email server and personal domain. The email address this person gives you when they sign up to your service could be anything from hello@janesmith.com or email@janesmith.com, to a service specific email address like companyname@janesmith.com. If Jane starts receiving a lot of unsolicited mail to that particular address, she knows who has sold her email address to a third party service.

There’s No Harm in Taking a Guess

It was back at Web Directions South in 2012 that Andrew Fisher first introduced me to the idea of contextually responsive experiences. While overall an incredibly valuable presentation, there was one particular slide that contained what would soon become one of my favourite UX tenets:

“Show the user what you know about them,

and allow them to correct it”

Users are inherently lazy. Despite your best intentions, they want to side step your boring on boarding process and get straight to the core of your product offering. The onus is therefore on you, the developer or designer, to ensure that mandatory fields are pre-filled with sensible guesses. But it’s okay to get it wrong, provided you show the user your best guess, and allow them to modify it themselves.

So check it out. It’s not an elaborate script, it’s merely a bunch of regexes. I don’t really get to hack on anything in my spare time any more — so please grant me this dalliance.

--

--

Tait Brown

I'm a UX designer/developer. I make stuff and tweet about shit user experiences. Works at A Cloud Guru.