Skip to content

A serverless function for storing receipts in google drive

License

Notifications You must be signed in to change notification settings

hintmedia/receipt-processor

Repository files navigation

Receipt Processor

A tiny serverless function currently in use at hint.io for converting emailed receipts into .pdf format and uploading them to google drive.

Problem: At Hint we keep all of our receipts in a single location in PDF format. Paper receipts are easy (we use Readdle's "Scanner Pro" app), but email receipts require conversion to PDF, then uploading to google drive. This was a manual process that nobody enjoyed.

Solution: We've automated the process with this serverless function. Anyone on our team can forward a receipt to a designated email address and it'll automagically be uploaded to our shared receipts folder in google drive.

How it works

  1. An Amazon SES rule uploads all emails received at a designated address to an S3 bucket.
  2. A lambda function is triggered on S3 object creation, renders the email in pdf format, then uploads it to google drive.

Can I use this?

Absolutely! Feel free to use it as-is, or adapt it for your needs. We use Google Drive at Hint, but swapping that out for dropbox or similar would be pretty simple. Have questions? Feel free to open an issue.

Setup instructions

  1. Create a service account which will be used to upload PDF's to google drive.
  2. Duplicate env.sample.yml as env.yml and add service account details, destination google drive folder id, and your preferred s3 bucket name (can be anything).
  3. Deploy the function to AWS. This project was built using the serverless framework. You can read up on that here: https://serverless.com.
  4. Setup an SES rule that'll store emails in the S3 bucket created when you deployed the function in the previous step.
  5. Profit!

License

Receipt Processor is released under the MIT License.

About

A serverless function for storing receipts in google drive

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published