React Email Parser Retrospective

Intro

I work for an email marketing company and work with clients often. Over the course of several years working here I've had on multiple occasions a client grab a list of email addresses directly out of their Outlook inbox and ask me to create a list in our application for them to send mail to. They usually looked something like this, but hundreds of addresses long:

Luke Skywalker <lskywalker@starwars.com>; Leia Organa <lorgana@starwars.com>; Han Solo <hsolo@starwars.com>; Obi-Wan Kenobi <okenobi@starwars.com>

Our uploader requires a plain text list of email addresses to get them added and ready to send to, so I found myself pasting that huge blob of Outlook addresses into a text editor and doing complicated find and replaces to get rid of all of the junk. After about the third time this request came in I thought, "There's got to be a better way!" *cue bad infomercial*

I was working on dipping my toes into React around that time, so I wrote this email parsing tool in React.

Code Review

The app is written in React, though that's probably a little bit of overkill since it's just a single page app. I wanted to practice the basics of grabbing some input, running it through a function and setting state in React, so this was a great little practice app. The parsing portion of the application is just running the input through a regular expression to match things that are the shape of an email address, adding a column header of 'Email' in case my coworkers wanted to paste that list into an Excel or CSV file, and adding in a line return between each match so that the user gets a nicely formatted plain text list of email addresses. You can test it out using the Star Wars email addresses listed above to see the output here.

Results

The app works great and it's already saved me from spending time doing this for another similar request. I shared it with my co-workers for when they get requests to do this and I've gotten word from one of them that they used it and it saved them a ton of time as well. So I expect that we've saved as many or more man hours than it took me to write this useful tool and you can't ask for much more than that!