-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Reply tracker for Outlook #721
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 16 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
ba3389c
Reply tracker for Outlook
elie222 7217edb
Merge branch 'main' into feat/track-replies-setting
elie222 752dade
fix up processing for microsoft
elie222 c3cdddb
remove duplicated code
elie222 6972181
remove duplicate functions
elie222 cd919be
clean up
elie222 09dbe47
Merge branch 'main' into feat/track-replies-setting
elie222 1e401e2
adjustments for reply tracking for outlook
elie222 60bc444
hide auto update reply action for user
elie222 44a4606
make auto update to reply its own setting and hide from rule card
elie222 259d357
simplify settings
elie222 66e9a4c
update copy based on provider
elie222 227cb14
adjust toggle setting into one action
elie222 76f7724
code cleanup
elie222 35dc58e
Merge branch 'main' into feat/track-replies-setting
elie222 3e6e2f2
Merge branch 'main' into feat/track-replies-setting
elie222 88c419f
mobile styling setup
elie222 32ebfec
only run claude code on manual trigger
elie222 b1a75e6
cr updates
elie222 c660ad3
Merge branch 'main' into feat/track-replies-setting
elie222 b784118
Merge branch 'main' into feat/track-replies-setting
elie222 b76b6d5
hide track thread action
elie222 2705cb2
Merge branch 'main' into feat/track-replies-setting
elie222 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,47 @@ | ||
| --- | ||
| description: | ||
| description: Reply tracking system that manages "To Reply" and "Awaiting Reply" labels automatically | ||
| globs: | ||
| alwaysApply: false | ||
| --- | ||
| # Reply Tracker | ||
|
|
||
| Reply Tracker (also known as Reply Zero) lets the user which emails need a reply for them and those they're awaiting a reply on. | ||
| It updates the labels for the thread automatically in Gmail. | ||
| Reply Tracker (Reply Zero) helps users track which emails need replies and which emails they're awaiting replies on. It automatically manages Gmail/Outlook labels based on email flow. | ||
|
|
||
| The database models and fields that are used for this feature: | ||
| ## Core Components | ||
|
|
||
| - ThreadTracker | ||
| - User.outboundReplyTracking | ||
| - ActionType.TRACK_THREAD | ||
| **Database Models:** | ||
| - `ThreadTracker` - stores tracking state and timestamps | ||
| - `EmailAccount.outboundReplyTracking` - enables outbound reply detection | ||
| - `ActionType.TRACK_THREAD` - action that removes "Awaiting Reply" labels | ||
|
|
||
| The system uses rules. The AI can choose which rule to use each time an email comes in. Rules are for incoming emails only. Not ongoing. | ||
| When enabling the reply tracker, we create a rule for the user that has the following actions associated with it: | ||
| - LABEL: "To Reply" | ||
| - TRACK_THREAD | ||
| - DRAFT_EMAIL (optional) | ||
| **Labels:** | ||
| - `"To Reply"` - emails that need your response | ||
| - `"Awaiting Reply"` - emails you sent that need their response | ||
|
|
||
| We'll draft a reply for the user automatically if DRAFT_EMAIL is set. The draft will be generated using the email history for this sender as well as the Knowledge base. See `.cursor/rules/features/knowledge.mdc` for more on the Knowledge Base feature. | ||
| ## How It Works | ||
|
|
||
| Enabling `User.outboundReplyTracking` means that when a user sends an email, we'll run an LLM over the email and check if it needs a reply. If it does we'll mark it as Awaiting Reply. | ||
| ### Inbound Flow (Receiving Emails) | ||
| 1. **Adding "To Reply"**: Regular rules with LABEL action add "To Reply" labels | ||
| 2. **Removing "Awaiting Reply"**: Rules with TRACK_THREAD action remove "Awaiting Reply" labels when replies arrive | ||
|
|
||
| ### Outbound Flow (Sending Emails) | ||
| 1. **Removing "To Reply"**: Always removes "To Reply" label when you reply (if `outboundReplyTracking` enabled) | ||
| 2. **Adding "Awaiting Reply"**: AI decides if your sent email needs a response and adds label accordingly | ||
|
|
||
| ## Settings | ||
|
|
||
| Users control this via one unified setting: | ||
| - **"Reply tracking"**: Controls both outbound tracking (`outboundReplyTracking`) and automatically adds TRACK_THREAD actions to "To Reply" rules | ||
|
|
||
| ## Key Files | ||
| - `apps/web/utils/reply-tracker/outbound.ts` - handles sent emails | ||
| - `apps/web/utils/reply-tracker/inbound.ts` - handles received emails | ||
| - `apps/web/utils/ai/actions.ts` - executes TRACK_THREAD action | ||
|
|
||
| ## Future Improvements | ||
| The current implementation works but has some architectural complexity that could be cleaned up: | ||
| - TRACK_THREAD action is hidden from users but managed via settings | ||
| - Two separate systems (outbound tracking + TRACK_THREAD actions) that need to stay in sync | ||
| - Hard-coded label names ("To Reply", "Awaiting Reply") - users can't customize these | ||
| - Could potentially be simplified to a more unified label-based approach in the future | ||
| - May want to support todos |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.