Monday, 9 October 2017

The Email Parser Guide: How to Automatically Copy Data From Your Emails

Ebay emailed—you just got a new sale. Your bank emailed with your monthly statement, your credit card is reminding you to pay your bill, and Apple's reminding you of that app you bought last night. And the contact form on your website is nice, but each message is another thing piling up in your inbox.

It's easy enough to sort through and manage data when it's in a spreadsheet or database. In your email inbox, though, notifications are just more clutter, something else to archive and forget. When you need something from those emails, that's when you'll have to take time to find the email, copy the text, and paste it somewhere useful.

Or, you could let an app do the busywork for you. Here's how to parse text out of your emails to put the data from those notification emails to good use—automatically.



What Is an Email Parser?

When you receive an email from your boss or best friend, you might read every word.

The rest of the time, odds are, you skim the message. Your eyes quickly dart across the screen, picking out keywords and phrases like New Sale and $4.99 and Payment Due: Friday, Nov 3.

Email parsers work the same way. You teach these programs how to recognize patterns in your emails, tell them what data is actually important and that everything else can be ignored, and then get them to save just the important stuff. Then, connect the email parser to an automation tool like Zapier, and it can copy and paste that important text into any other app you want—logging the orders in a spreadsheet, for example, and reminding you to pay your credit card bill tomorrow. As long as the emails are all laid out generally the same way, the email parser should be able to figure out what's important and copy the data for you.


Got that? Ok. Let's back up, and step-by-step build an email parser that can copy text out of your emails and put it to work. We'll use Zapier's Email Parser—a free tool to copy text out of your emails—and then look at other tools that can do even more with your emails. The basics work the same in every app, and once you know how to parse one email, you know how to parse them all.

Onwards.


1. Make a new email parser
2. Forward an Email to the Parser
3. Teach the parser how to read your email
4. Automatically forward emails to the parser
5. Put your parsed email data to work

Make a New Email Parser

Zapier Email Parser Create

The first step is the easiest. Just go to parser.zapier.com, make an account if you don't have one yet, then click the Create Mailbox to add a new email parser.

Email Parser will then show you an email address like 1asdfe2fg@robot.zapier.com. Copy that address.

2. Forward an Email to the Parser

Email to parse

Now it's time to send the first email to be parsed. Open your email app, find an email like the ones you want to copy data from. I'm going to have Email Parser notify me about new App Store purchases—so I got an App Store email.

Forward the email, put your @robot.zapier.com email address in the To: field, and click Send.

3. Teach the Parser How to Read Your Email

Select text to be parsed
Select the text you want the parser to copy, then give it a unique name

Time to put on your teacher hat. Once Zapier Email Parser receives your email, it'll show a text version of your email in the Initial Template box. All you need to do is find the important data and tell the parser that this is what to copy out.

Scroll down to the text that you want the Email Parser to copy, and select that text. With my App Store emails, I want to know what I'm being charged for, so I select the text of the product name. Type a name for that item in the box, click Save, and the Email Parser will replace the text with the name in curly brackets, like .

Repeat that for everything else you want the email parser to copy. I went ahead and selected the total price, too.

Once that's done, click the blue Save Address and Template button at the bottom—and your email parser is ready to work.

Email Parser Second Template
Select the same text you want to copy, and give it the same name to teach the Email Parser how to handle variations in your emails

Want to make your Email Parser more reliable? Forward another similar email to the same address, then click the Mailbox link in the top right and click the link under Last Email beside your parser's name. That'll show your most recent email—with the text Email Parser selected in yellow.

If that's incorrect, click the Edit extra template link near the bottom. Select the same text you'd originally wanted to copy from your emails, give it the same names, then save this new template. And if you want, repeat that again with yet another email for an even more reliable parser.

4. Automatically Forward New Emails to the Parser

Gmail search filter

The Email Parser you just made is now ready to copy text from other similar emails—App Store receipts, in this case. We just need to send every new App Store receipt to the email parser.

The best option is to automate things with a filter in your email app to automatically forward messages that match the one you sent to Email Parser. Typically, your notification emails will all have something in common—they'll come from the same sender, and often have the same subject. App Store receipts, for instance, come from no_reply@email.apple.com and have the same Your receipt from Apple subject.

To watch for those emails in Gmail, you'll first need to add your email parser address to Gmail so you can automatically forward emails. Here's how:

  • Open your Gmail Forwarding settings—click the gear icon, select Settings, then click the Forwarding tab.
  • Click the Add a forwarding address button there.
  • Enter your Email Parser @robot.zapier.com email in the text box and click next.
  • Check your email—Zapier should send you a confirmation email from Gmail. If you don't see it, check the Email Parser app's mailbox—it should have the email. Either way, copy the confirmation code, then paste it in the box back in your Gmail Forwarding settings.

Now you can have Gmail automatically forward emails to your email parser. First search for the email address and/or subject of the messages you'll have the email parser process; I'll enter from:no_reply@email.apple.com AND subject:"Your receipt from Apple". Click the tiny down arrow on the right of the search bar to see the full Advanced Search options—then click the Create filter with this search link in the bottom right corner. Have that filter forward the email to the email parser address you just added—and you should be all set.

After a bit of mouse and keyboard exercise, you're done. Every time Apple sends you an App Store receipt—or whenever you receive whatever other email you want to parse—Gmail will send it along to the Email Parser.

5. Put Your Parsed Email Data to Work

Use Zapier to automatically use your parsed email data

Copying text out of emails alone isn't enough—you need to do something with that data. The easiest option is to connect your Email Parser to Zapier's app automations, which lets you send data from your emails to 750+ other apps—from Airtable to Zoho.

Visit Zapier and log in or sign up if you haven't already. Then click the orange Make a Zap button in the top right corner. Select Email Parser as the trigger app, then choose the New Email trigger. Connect your Email Parser account if you haven't already, and pick the parser address you just set up.

Zapier automation with email parser
Zapier can use the text Email Parser finds however you want

You can then put your email data to work. In the Action step, select the app you want to send your email data to. I wanted to get an SMS notification about my App Store receipts, so I picked the SMS app's Send SMS action.

To use your email data, click the + button beside any of the fields from your app. Here, I've added the purchase name and price from Email Parser to the SMS notifications—you could perhaps add names and emails to your email newsletter, log sales info to rows of a spreadsheet, or use your email data however you want.

Test the Zap to make sure everything works the way you want, turn it on, and you're done!


Now, whenever an email comes in with details you need to save, your email app will forward it to Email Parser, which will skim your email and copy out the important info, then send it to Zapier, which then sends it to the app that needs your data. It's the most productive Rube Goldberg machine yet.

The Best Email Parser Apps

Zapier's Email Parser isn't the only way to copy text out of your emails. It's a great tool, and one of the easiest to setup and use. But it's only designed to parse text from your emails, and may fail at copying text if your email formatting changes much.

Need more power for your email parsing? There are a handful of other tools that can do similar things, watching for new emails and parsing out the text you want—often with even more features for those most difficult emails.

Here are the best apps to parse your emails:

mailparser.io

for automatically finding data to parse

mailparser.io Screenshot

mailparser.io can make your email parsing setup even faster—and much more precise. Start out the same as you would with Zapier's Email Parser: Make a new inbox, copy its unique mailparser email address, and forward your emails to it. Go ahead and send a few similar messages to get started.

As soon as the emails come in, mailparser.io will try to figure out the common patterns in your email—things like names, dates, prices, order numbers, and more. It'll show them in a table automatically, and if everything looks good, you can just turn on the email parser and let it run without tweaking anything else.

Mailparser.io customize email template

Odds are, though, you'll want to keep customizing to extract exactly what you want from your messages. Open the Parsing Rules tab in mailparser.io, then select any of the pre-made rules—or add a new one. There, you can have mailparser.io filter out common text like links and blank lines, then tell it exactly what to watch for before and after the text you're parsing. It can count a specific number of characters, find the next blank space or line, or look for an exact text string.

It can also parse other things in your email. Need to copy all entries of a table—even when sometimes there will be more entries than others? Add an Extract Tabular Data text filter, and mailparser.io can copy the full table or XML content for you. It can even copy text from PDF or text attachments on your emails.

Parseur

for parsing data directly from HTML and rich-text emails

Parseur Screenshot

Both Zapier's Mail Parser and mailparser.io turn your emails into plain text—you can see all the core details from your HTML rich emails, without the images and formatting. That works—and mailparser.io lets you make advanced filters—but it can be difficult to use.

Parseur simplifies things with an HTML parser that shows your messages just like they look in your inbox. Set up an email parser the same way—add an inbox, copy the address, forward an email—then you can make a new template in Parseur. Just click on the text you want Parseur to copy, add a name for the field on the right sidebar and click Create, then repeat for everything else you want to select. It's easy to quickly pick out what needs copied with the normal, rich-text email view.

See parseur results
See the parsed text in a table, alongside the original email

Then, you can use Parseur as an email inbox with an archive of your parsed emails. Click through the Documents tab to see every email that Parseur received—and open them to see the original email along with a table of the copied text.

If Parseur can't figure out what to do with an email, it'll show it highlighted in red on your Documents list. Open the email and click the + icon in the right corner to add a new template, and Parseur will then parse that email and use the extra template as a backup next time.

  • Parseur Pricing: from 9€/mo (~$10.60 USD) Starter plan to parse 100 emails/month
  • Connect Parseur with 750+ apps and build an email parsing workflow with Zapier's Parseur integrations.
  • For a deeper look at Parseur's features and pricing, check out our Parseur review.

Bonus: Parse Email Messages with Regex and Zapier Formatter

Zapier Formatter Regex
Using Zapier Formatter, you can automatically copy out phone numbers, links, email addresses, and more from any text—including an email

Only want to copy phone numbers, links, email addresses, and other easily recognizable text from email messages? You don't even need an email parser. All you need is a regex—or Regular Expression—script that can find text that matches the pattern you're looking for.

With a regex script, you could search through your email text inside a text editor like Sublime Text and copy out the items you want in seconds. Or, using Zapier's Formatter tool, you could have Zapier watch Gmail for a new email, use Formatter to find, say, a link or phone number in the text, and then add another action app to your Zap that puts your text to work.

Another option: You could use this Gmail Parsing Google Script from ctrlq.org to use regex scripts right inside Gmail that find data in your emails and copy it to a Google Sheet.

Here's how, in our in-depth guide on how to extract text with regex and Zapier Formatter.


Put Your Parsed Emails to Work with Automations

You've learned how to parse emails and found the perfect app for the emails you need to parse. All that's left is to start using that parsed text in your work. Just as in the example above, you can connect your email parser to Zapier, then automatically send every parsed email to your CRM, eCommerce tool, project management app, and more.

Here are some of the most popular ways to use parsed email data with Zapier:

Save Your Parsed Email Data to a Spreadsheet

One of the easiest ways to use your email data is to save it to a spreadsheet. There, you can sort and filter the data or easily import it into another app. Zapier can save your email data to a Google Sheets or Excel spreadsheet—or a database—automatically for a list of everything you need in one place.

Get Notified About Parsed Emails

Want to get an SMS with the simpler details from your parsed emails? Or perhaps you'd rather get another email with just the important text or notify your team in Slack. Either way, you can do this automatically.

Add New Subscribers to an Email List

You could automatically copy email addresses of people who contact your company and add them to an email list, but you'd miss out on lots of important data. An email parser can help fill in the blanks, copying all their contact info before adding them as new subscribers.

Create CRM Contacts and Leads from Emails

Whether you're parsing messages from your contact forms or order receipts from an eCommerce store, save your email data to a CRM to keep as many details on your contacts and customers as possible.

Start Projects and Tasks with Parsed Emails

Don't let work pile up in your inbox. Parse the emails, and let Zapier turn those messages into tasks and projects you'll actually complete.


Email's the default way for most apps to send you info—and can be the best way to automate apps that don't have their own integrations. With an email parser and Zapier workflows, your inbox can get your most important emails working for you as soon as they come in—no more copying and pasting from your inbox.

Want to make your inbox even more productive? Here are some great Zapier guides to help:

If you're using email parsers to help your work, we'd love to hear how you're using them in the comments below!

Ocean background photo by Dimitris Vetsikas via Pixabay



source https://zapier.com/blog/email-parser-guide/

No comments:

Post a Comment