Skip to content

feat: make amount of items sent on email configurable via occ#2673

Open
cristianscheid wants to merge 1 commit into
masterfrom
feat/1533/mail-items-configurable
Open

feat: make amount of items sent on email configurable via occ#2673
cristianscheid wants to merge 1 commit into
masterfrom
feat/1533/mail-items-configurable

Conversation

@cristianscheid

@cristianscheid cristianscheid commented Jun 22, 2026

Copy link
Copy Markdown
Member
  • Resolves: #

Summary

Context

  • activity emails are sent to users via the OCA\Activity\BackgroundJob\EmailNotification background job
  • the background job calls MailQueueHandler::sendEmails()
  • MailQueueHandler::ENTRY_LIMIT defines how many activities are fully shown in the email body, anything beyond that is truncated, as shown below:
image

Changes introduced by this PR

  • adds an admin-configurable setting to control the max number of activities fully shown in notification emails:
occ config:app:set activity mail_max_items --value=500
  • falls back to 200 (original value) when no configuration is set
  • adds MailQueueHandler::MAIL_MAX_ITEMS_CAP as a safeguard against excessively large values

TODO

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@cristianscheid

Copy link
Copy Markdown
Member Author

Please note that psalm CI error is unrelated.

Comment thread lib/MailQueueHandler.php Outdated
@miaulalala

Copy link
Copy Markdown
Collaborator

Can you please add some tests?

@cristianscheid cristianscheid force-pushed the feat/1533/mail-items-configurable branch from e206438 to 27d5fe4 Compare June 23, 2026 11:03
@cristianscheid cristianscheid added this to the Nextcloud 35 milestone Jun 23, 2026
Signed-off-by: Cristian Scheid <cristianscheid@gmail.com>
@cristianscheid cristianscheid force-pushed the feat/1533/mail-items-configurable branch from 27d5fe4 to c5a7934 Compare June 23, 2026 11:15
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.

2 participants