What This Workflow Does
This helper consists of two parts: an AppleScript and a Shortcuts workflow. The AppleScript is a Mail rule that triggers the Shortcuts workflow. The Shortcuts workflow then takes the email and turns it into a note in your Obsidian vault.
This basically adds a “Note to self” ability to your Obsidian vault(s), which uses what you already have and use: your existing email account and macOS.
Good to know:
- For obvious reasons, your Mac and the macOS Mail app must be running for this work. (Mail can be in the background, though.)
- It makes use of Mail’s rules feature and AppleScript, both of which are not available on iOS — this is a macOS-only workflow.
Download & Installation
Download Apple Shortcuts workflow “Mail to Obsidian note.shortcut”. Double-click the downloaded file to install the workflow in Shortcuts.
Download AppleScript “Send Mail to Shortcuts.scpt”. Copy or move the downloaded .scpt
file into the folder ~/Library/Application Scripts/com.apple.mail/
. (If you have trouble finding that directory: open a Finder window, open the menu entry “Go” → “Go to Folder…” (or press ⇧⌘G
), then paste the path ~/Library/Application Scripts/com.apple.mail/
into the following prompt, and hit Enter.)
Requirements
- Actions for Obsidian
- macOS Mail app + an existing email account
- Obsidian
Explainer video
Workflow Screenshot
Workflow history / Change log
2023-10-24
Adds link back to original message in Mail.app to the note.
2023-06-22
First version.
Update on 2023-10-24! Now the resulting note contains a link back to original message in Mail.app.
I like this a lot. But I wonder how it’s possible to specify a specific folder for these e-mail-turned-notes within my vault? Now I can just give the name of my vault, which makes it so that all the e-mails are just sitting there unsorted. I’d rather dump them into an appropriate place.
Welcome to the forum, @Reasder!
Yes, it’s possible. See the screenshot in the original post, and check out the very last action, Create Note. In the first parameter, where it reads [Mail subject]
(“Mail subject” being a variable), you would change that to My folder/[Mail subject]
— i.e., prefix the variable in that parameter field with your folder name, like so:
Hope this helps!
1 Like
The Script is great - thank you!
Is it possible to transfer an attachment of a mail to Obsidian as well?
@HotuMatua No, not yet. Two reasons:
- The used Applescript doesn’t export any attachment info
- Actions for Obsidian doesn’t support attachments and files yet (planned for v1.5, however)
And welcome to the forum!
Thank you very much for the quick reply.
Nice to be here!
Thanks for sharing this @czottmann – This is great and not only for a “Note to Self”:
I was looking for a way to build a slim CRM in Obsidian and this looks like one crucial piece to get it done.
Maybe also helpful for others: As Carlo pointed out in the video, you can work other filters too:
So you can specify e.g. that they are in your contacts or in a certain group (and this way you could even run different shortcuts [and saving locations in Obsidian] depending on groups).
Great stuff