Upload email attachments to S3
@dylan
code:
data:privatelast updated:4 years ago
@dylan/
Upload email attachments to S3

Usage

When you fork this workflow, you'll get a unique email address like e12345678910@pipedream.net. Sending email to this address will run your workflow. You can send attachments in your emails, which will get saved in the S3 bucket you specify.

You'll need to connect an AWS account (access and secret key) to the save_to_s3 step. The user tied to these keys should have PutObject permissions on the target bucket.

You'll also need to enter the name of the bucket in the Bucket field of the form.

Once this is done, try sending an email with a "test" subject and an attachment. You'll see the attachments show up in S3 at a prefix that contains the email subject and the timestamp the email was sent:

test attachment

Modifying this workflow

You might have a slightly different use case for how you want to handle email attachments. Once you fork this workflow, you can modify it however you'd like, changing any of the code, or adding or removing steps. Check out the Pipedream docs to learn more,

Random note

This is slightly inefficient, because it saves the base64-encoded file data to /tmp before then reading it and uploading it to S3. We could have sent the data directly to S3, but I thought it'd be a nice excuse to show you you can write / read from the /tmp directory in workflows!