mail icon indicating copy to clipboard operation
mail copied to clipboard

feat: follow up reminders

Open st3iny opened this issue 1 year ago • 2 comments

Implements https://github.com/nextcloud/mail/issues/3996

Diff is containing a lot of tests.

Testing

  1. 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)
  1. 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

  1. Sending a mail adds it to the sent mailbox.
  2. The next sync will pick up changes in the sent mailbox.
  3. A classifier job will be queued for each new sent mail after a couple of days.

Classifier Job

  1. Check if a sent message has been responded to by checking its thread for newer messages (meaning there was a reply).
  2. If not 1.) Run a LLM free prompt task to check if an email requires a follow-up.
  3. If 2) Tag the message with $follow_up to notify the frontend.
  4. 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
Screenshot_20240510_130745 Screenshot_20240510_131036

TODO

  • [x] Fix Load more button
  • [x] Add dedicated Follow up button 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

st3iny avatar Apr 15 '24 10:04 st3iny

Bildschirmfoto vom 2024-05-28 14-53-02

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?

ChristophWurst avatar May 28 '24 13:05 ChristophWurst

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.

st3iny avatar May 29 '24 10:05 st3iny

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.

st3iny avatar Jun 24 '24 15:06 st3iny