Skip to content
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

feat: follow up reminders #9567

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

feat: follow up reminders #9567

wants to merge 5 commits into from

Conversation

st3iny
Copy link
Member

@st3iny st3iny commented Apr 15, 2024

Implements #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

  • Fix Load more button
  • Add dedicated Follow up button to the thread view
  • Remove dead debugging code
  • Add server version check (if required)
  • Add setting for the feature (default value?)
  • Translate tag name if left default
  • Tests?!
  • Bug: Clear follow-up state when a reply is received after the message was classified
  • Respect Groupware admin settings → Use global LLM setting
  • Escape quotes in email text prompt template
  • Hide the user settings checkbox when LLMs are disabled
  • Trying to configure method "getValueString" is only present in >=29 ...
  • Add screenshots
  • Force syncing sent mailbox in the background if feature is enabled

@st3iny st3iny force-pushed the feat/follow-up-reminder branch 2 times, most recently from 4e4f604 to 1730950 Compare April 30, 2024 06:22
Signed-off-by: Richard Steinmetz <[email protected]>
If the number of available envelopes is lower than the initial page size,
the list will still be expanded without any effect. Only the second click
will trigger loading more envelopes.

Signed-off-by: Richard Steinmetz <[email protected]>
@st3iny st3iny marked this pull request as ready for review May 10, 2024 11:35
@ChristophWurst
Copy link
Member

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?

}

$this->logger->debug('Message requires follow-up: ' . $message->getId());
$tag = $this->mailManager->createTag('Follow up', '#d77000', $userId);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we discussed before but there is no way to localize this because the label value is equal to it's displayed text, right?

Copy link
Member Author

@st3iny st3iny May 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessarily. The createTag() method generates a label's value from its display text. Currently, there is no way to specify display name and label value at the same time using this method. I could adjust the API though, e.g. another optional parameter with the label value/id.

The label is localized in the frontend (if the user didn't rename it manually).

@st3iny
Copy link
Member Author

st3iny commented May 29, 2024

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 st3iny linked an issue May 29, 2024 that may be closed by this pull request
3 tasks
Copy link
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested & works

Design-wise we will need to tone down on the primary elements

Bildschirmfoto vom 2024-06-06 08-13-02

Disable reminder could be secondary.

The test email went to myself. Why do I see follow-up reminders for the outgoing and ingoing message? bug?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Follow-up reminder (nudges)
2 participants