feat: follow up reminders
Implements https://github.com/nextcloud/mail/issues/3996
Diff is containing a lot of tests.
Testing
- Disable the delay in the frontend to show follow up reminders right away.
Comment or remove the line: src/components/MailboxThread.vue:207
//notAfter.setDate(notAfter.getDate() - 4)
- Reset the classifier job to make it run on the next cron job (and trigger it).
update oc_jobs set last_run = 0, last_checked = 0 where class like '%FollowUpClassifierJob%';
Architecture
Admins can disable LLM related features completely in the admin/groupware settings section. User can opt-out of this feature through the mail settings modal (bottom left one). It is enabled by default.
The feature will only be applied to new sent emails and not to existing ones. Adding a new account or resetting the cache of the sent mailbox will only trigger the feature for emails not older than 14 days to prevent a job spam.
Classifier Listener
- Sending a mail adds it to the sent mailbox.
- The next sync will pick up changes in the sent mailbox.
- A classifier job will be queued for each new sent mail after a couple of days.
Classifier Job
- Check if a sent message has been responded to by checking its thread for newer messages (meaning there was a reply).
- If not 1.) Run a LLM free prompt task to check if an email requires a follow-up.
- If 2) Tag the message with
$follow_upto notify the frontend. - Otherwise) Do nothing.
Frontend
- Tagged messages will be shown in the priority mailbox after 4 days.
- Reminders can be followed-up with a dedicated button.
- Reminders can be dismissed through a dedicated button (just deletes the tag).
Screenshots
| Priority inbox | Thread view |
|---|---|
TODO
- [x] Fix
Load morebutton - [x] Add dedicated
Follow upbutton to the thread view - [x] Remove dead debugging code
- [x] Add server version check (if required)
- [x] Add setting for the feature (default value?)
- [x] Translate tag name if left default
- [x] Tests?!
- [x] Bug: Clear follow-up state when a reply is received after the message was classified
- [x] Respect Groupware admin settings → Use global LLM setting
- [x] Escape quotes in email text prompt template
- [x] Hide the user settings checkbox when LLMs are disabled
- [x]
Trying to configure method "getValueString"is only present in >=29 ... - [x] Add screenshots
- [x] Force syncing sent mailbox in the background if feature is enabled
classification works. but how am I able to see the nudge? I have modified oc_mail_messages.sent_at to fake time. Do I need anything else?
classification works. but how am I able to see the nudge? I have modified oc_mail_messages.sent_at to fake time. Do I need anything else?
The reminder is probably hidden in the frontend and will be shown after 4 days. I added some instructions to the PR's description.
I lowered the severity of the disable reminder button and moved the follow up button to the bottom. It will now properly replace the reply button. The screenshots in the description are up to date.