Automate email body to PDFs and capture in DEVONThink

I’ve been building something similar in recent times.
It’s still a work in progress, but so far I am saving emails + their attachments to Dropbox using Integromat.
I then have Hazel convert the HTML body of the mail to PDF using “wkhtmltopdf”.

Here is the Integromat flow (the bottom half is the part that saves the HTML or TXT body):

And this is the shell script, that Hazel runs on the html file (after I have run some renaming automation):

PATH='/usr/local/sbin:/usr/local/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/local/bin'

wkhtmltopdf --encoding utf8 "$1" "${1%.*}.pdf"

This is, where I asked for help building it, here on the forum: Hazel HTML to PDF conversion

1 Like