Skip to content

rickh94/attaskcreator

Repository files navigation

Airtable Task Creator

build status

Creates entries in an Airtable 'Tasks' table linked to people in a people table from emails sent to those people (and copied to a burner email account). If the email address is not in the table, a new record will be created for that person.

Installation

The simplest way to install is to run sudo python install.py.

You can install with some options to get some extras

Argument Description
-h, --help show this help message and exit.
-p INSTALL_PREFIX, --install-prefix INSTALL_PREFIX Specify alternate installation prefix
-s, --install-units Install systemd service and timer from extras
-c CONFIG_FILE, --config-file CONFIG_FILE Specify a configuration file

Usage

This is most useful when automated in some way. Systemd units are included. All options are in the configuration file so simply run the script periodically.

Configuration

TO BE UPDATED: config now lives in login.conf, tables.conf, and phrases.conf

An example configuration file is included. The can be copied and modified and installed with -c. The example will be copied to /etc/attaskcreator for future reference. Fields are as follows:

[Email]

User: burner email to retrieve emails from

Password: password for the burner email. You should enable two factor and generate an app password because it will be stored in plain text. Also do not run this on from a server you do not fully control.

IMAP URL: url for imap retrieval of burner email

SMTP URL: url for smtp sending from burner email

Error Email: your email to send a message to if a record is not created.

[Airtable]

API Key: The api key for the database you want to use. (See the Airtable Documentation for more information.)

Database ID: The database id for the database you want to use. This is the part of the api url after /v0/.

[AWS]

Access Key ID: Api access key id for uploading attachments temporarily to s3

Secret Access Key: Secret key for uploading attachments temporarily to s3

Bucket: Bucket for uploading attachments temporarily.

Airtable can only accept files in the form of urls to download. Current implementation uploads attachments to s3 and generates a pre-signed url for Airtable to use. It is recommended to configure an AWS user that has access only to the bucket used for this and expire the objects in that bucket very quickly.

[Tasks Table]

This is the table that new records will be inserted into

Name: the name of the table

People Link Field: The field that is linked to the people table

Attachment Link Field: The field that is linked to the files table

Text Field: The field where the parsed text will be inserted

Notes Field: Optionally the full text of the email can be inserted into this field, leave out to not do this.

[People Table]

This is the table with all the people in it.

Name: the name of the table

Email Field: The field containing the email addresses

[Files Table]

This is the table that will have attachments uploaded to it.

Name: the name of the table.

Key Field: the primary key for the table.

Attachment Field: The field where the actual attachments will be uploaded.

[Parse]

Termination Character: see above.

phrases.conf Trigger Phrase: This is the prefix to the text that will be grabbed from the email. Everything after this will be grabbed for the Text Field in the Tasks Table up to the Termination Character.