rickh94 / airtable-reminder-email-parser

Simple python script to parse text for emailing something to airtable through zapier

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Airtable Reminder Email Parser

A python script for Zapier to work with incoming emails (gmail service) to created airtable records. It takes a plain text input (e.g. an email body) and outputs matched text and a boolean for flow control.

Input

It takes plain text as 'body' for input. In the case of an email, be sure to select 'Body Plain' not 'Body HTML.'

Text Matching

All text is matched after a trigger phrase (trigger_phrase) up to a terminating character (term_char). These are hard-coded but could be set as inputs in zapier with a little tweaking (watch out for python regex syntax).

trigger_phrase default is THIS IS A TEST. Replace only this text to customize the phrase. Leave the r, quotes, and parentheses so that the python search still works. Not case sensitive.

term_char defaults to a period. Replace only the period to customize it.

"Zap" Structure

The test zap had the following structure:

  1. Gmail: New Email (a dedicated account or some kind of search based filter. doesn't matter.)
  2. Run Python (Copy the contents of parse_text.py here.*)
  3. Filter: Only continue if (2: Run Python: Matched)
  4. Airtable: Create Record. Connect the text of the record to 2: Run Python: Insert Text (I also put the full text of the email in a note and the date from the email in a 'created' field. You can pass the date directly from the email but if you try to do the time as well you can get timezone issues).

* It is important to only copy from below # COPY THIS CODE INTO ZAPIER or the input may be overridden which defeats the whole point.

About

Simple python script to parse text for emailing something to airtable through zapier

License:GNU General Public License v3.0


Languages

Language:Python 100.0%