Email Processing
Learn how to use emails as triggers, and capture information from them or perform actions on them.
Last updated
Learn how to use emails as triggers, and capture information from them or perform actions on them.
Last updated
If you are not an active Apple Mail user yet, first setup Apple Mail, let it download all emails, and then enable the extension. Else all your emails will be sent to the AI provider.
To get started with email processing, you will need to enable the Apple Mail extension. Apple Mail is required for Inbox AI to be able to process email, but it can be running in the background while you using another email application if you prefer.
In Mail, go to "Settings", and then "Extensions", and check the Inbox AI extension.
Restart Apple mail after enabling the extension, else email processing will not work.
After enabling, all incoming new email will be processed by Inbox AI. All processing happens on device, but email will be sent to your selected AI provider. You can disable processing, by unchecking the extension or by selecting "Do Nothing" as the email processor in the general settings.
Finally, you can customize the maximum age of incoming emails to process. To test the email processing, send yourself an email and wait for it to process. By default the "Process email" action is used to process incoming email. Let's check it out.
The process email is an Ask AI action. The prompt is sent to the default AI provider you have chosen. The AI is given the ability to choose which action to call next, only these actions are available to the AI. In this example it has two options:
Pick a category
In the prompt, you can specify the behavior you are looking for. The {{ value }}
placeholders in the prompt will be replaced by variables before sending them to the AI. In this case the {{ originalInput | process }}
is the simplified incoming email, and your name is also inserted. For more information on templating, see the Templating page.
When the AI picks an email category, it calls the category action. Open it in the sidebar to check it out.
This is a Multiple Choice action, it routes an incoming value another AI chose, to another action. Here you can see that "Junk" is linked to "Move to Junk". And, more interestingly, "Task" is linked to another Ask AI action, that aims to extract tasks and add them to Apple Reminders.
You can change the behavior here, or build your own actions to fully control the behavior of the AI.
If for any reason you want to ensure only specific emails go into an AI action, you can use the power of the Templating in Inbox AI. Below is an example for a prompt that achieves this.
Check each Ask AI action in the chain to ensure your email does not get inserted into a later AI request prompt.
The conditional if statement only returns a prompt when the originalInput has a line that matches the "To:" email header. Note that the match is a regular expression. It goes beyond this guide to explain these, but ChatGPT can help. Check the Logging to see what is sent to the AI.
Empty prompts will not trigger an actual request to the AI and are assumed to be a signal that the AI should do nothing.