Skip to content

[stack] feat(mail): add sender, note, details and buttons blocks to email template - #65193

Merged
skjnldsv merged 1 commit into
masterfrom
feature/mail-template-blocks
Oct 6, 2026
Merged

skjnldsv merged 1 commit into
masterfrom
feature/mail-template-blocks

Conversation

@skjnldsv

@skjnldsv skjnldsv commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Summary

Share, calendar and Talk mails all show a person and an item, and right now the only tool for that is list items with tiny icons. This adds four blocks to the email template. The restyle comes in #65194, and #65195, #65220, #65221 and #65222 move the mails to the new blocks.

Method Renders
addBodySender($name, $subline) Initials circle, name, optional email
addBodyNote($text, $label, $type) Box for a user's note, or an info/warning/error message
addBodyDetails(EMailDetails) Card with title, subtitle, initials or date badge, labelled rows
addBodyButtons($buttons, $label) Any number of buttons, first one primary

None of them take HTML: everything is escaped and each block writes its own plain text version.

All four blocks in the current look (the test fixture), before the restyle:

blocks-email-light-700

TODO

  • Document in the developer manual
  • Limit link URLs to http(s) and mailto?

Checklist

  • Code is properly formatted
  • Sign-off message is added to all commits
  • Tests are included
  • Screenshots before/after for front-end changes
  • Documentation has been updated or is not required
  • Backports requested where applicable
  • Labels added where applicable
  • Milestone added for target branch/version

AI (if applicable)

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

👾 This pull request was assisted by Claude Code, commits carry an Assisted-by trailer.

@skjnldsv skjnldsv added this to the Nextcloud 36 milestone Oct 6, 2026
@skjnldsv skjnldsv self-assigned this Oct 6, 2026
@skjnldsv
skjnldsv requested a review from a team as a code owner October 6, 2026 14:49
@skjnldsv
skjnldsv requested review from CarlSchwan, come-nc, leftybournes and provokateurin and removed request for a team October 6, 2026 14:49
@skjnldsv skjnldsv added enhancement 3. to review Waiting for reviews feature: emails AI assisted pending documentation This pull request needs an associated documentation update labels Oct 6, 2026
@skjnldsv
skjnldsv added this pull request to stack #65196 October 6, 2026 14:56
@skjnldsv skjnldsv changed the title feat(mail): add sender, note, details and buttons blocks to email template [stack] feat(mail): add sender, note, details and buttons blocks to email template Oct 6, 2026
@skjnldsv
skjnldsv force-pushed the feature/mail-template-blocks branch from 0800355 to d0723ad Compare October 6, 2026 14:57
…plate

Adds addBodySender, addBodyNote, addBodyDetails and addBodyButtons to
IEMailTemplate, with the EMailDetails and EMailDetailsRow value classes
for the details card. All values are escaped by the template, each block
also renders a plain text version.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: John Molakvoæ <14975046+skjnldsv@users.noreply.github.com>
@skjnldsv
skjnldsv force-pushed the feature/mail-template-blocks branch from f412a28 to 9e39985 Compare October 6, 2026 18:23
@skjnldsv
skjnldsv added this pull request to stack #65223 October 6, 2026 18:34
@SebastianKrupinski

Copy link
Copy Markdown
Contributor

Hi @skjnldsv

Since we are redoing the email templates, would it make sense to extract them in to external files? Instead of hard coding them in PHP, this is messy.

If they where external files in the themes folder they could be easily customized on a per instance or per group level.

Yes, I know this might be out of scope, just an idea

@skjnldsv

skjnldsv commented Oct 6, 2026

Copy link
Copy Markdown
Member Author

Since we are redoing the email templates, would it make sense to extract them in to external files? Instead of hard coding them in PHP, this is messy.

yes, this is in my todo; After this whole stack is merged, I'll focus on doing a cleaner refactor where each block has its own php file. Should be cleaner, easier to test and more flexible :)

@skjnldsv
skjnldsv merged commit acc1037 into master Oct 6, 2026
155 checks passed
@skjnldsv
skjnldsv deleted the feature/mail-template-blocks branch October 6, 2026 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews AI assisted enhancement feature: emails pending documentation This pull request needs an associated documentation update

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants