E-mail (Apple Mail) -> PDF -> DEVONthink -> Archive original e-mail

I currently archive all receipts that come via e-mail as PDFs in DTPro. In fact, I archive all receipts period as PDFs in DTPro, the others I get there via my ScanSnap. Fro the e-mail receipts, though, I would love to have it be a bit automated. I know that any e-mails I receive, say, from Lyft, with the subject line “Lyft Ride Receipt”, need to be archived. There’s no reason I should have to do it myself. Is there a way to automate this process?

Currently my non-automated process is:

  1. Find e-mail in Apple Mail
  2. Print to PDF -> Save to DTPro Inbox
  3. Archive e-mail

The front-end never touch-it method would be to create a rule in Mail preferences: Rules that identifies the emails you want to archive and create an AppleScript that runs the magic on the attachment and moves it to an Archive. You could also run a mail rule that would forward the message to a designated folder that Hazel is monitoring and you may be able to get more granular control from there.

I’m not an AppleScript person, per se. Any guidance here on, at the very least, an example to work off of?

Has anyone worked out how to save an email as PDF using mail rule and AppleScript? Also looking for a way to save receipts.