Skip to content

Feat: Make use of the Nextcloud default Mailtemplate for recognition. - #5733

Open
T0mWz wants to merge 10 commits into
nextcloud:mainfrom
sara-nl:OCMinvitationMailTemplate
Open

T0mWz wants to merge 10 commits into
nextcloud:mainfrom
sara-nl:OCMinvitationMailTemplate

Conversation

@T0mWz

@T0mWz T0mWz commented Sep 17, 2026 •

Copy link
Copy Markdown

When an OCM invitation request is sent, it is currently a plaintext email. Since we will be exchanging data here and the outside world isn’t always trustworthy, we want to provide the user with some identifying features. It is therefore recommended to use the Nextcloud standard email template, which the user may already recognize from the service and which also displays the service’s logo, color, and name.

We are expanding the OCM invitation flow using the standard Nextcloud email template.
CurrentMailTemplate

The email now uses Nextcloud core's standard IEMailTemplate (same as sharebymail, IMipPlugin, NewUserMailHelper, etc.), so the branded header/footer, button styling, and light/dark-safe HTML come from core instead of hand-rolled <br> markup.

NextcloudMailtemplate

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI (N/A)
    With use of Claude was this PR created

Summary by CodeRabbit

  • Improvements
    • Invitation emails now present the sender’s name, invitation link, and personal message in a consistent format. Sender copies also use a translated “Copy” prefix in the subject line. These updates apply to both new invitations and resent invitations.

@T0mWz

T0mWz commented Sep 18, 2026

Copy link
Copy Markdown
Author

@mickenordin , @redblom , FYI :-)

@mickenordin mickenordin left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me, although you need to sign off all commits, dco test is failing.

Signed-off-by: Tom Wezepoel <tom.wezepoel@surf.nl>
@T0mWz
T0mWz force-pushed the OCMinvitationMailTemplate branch from e5e7ee1 to 2888a2d Compare September 18, 2026 12:42
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

@T0mWz

T0mWz commented Oct 13, 2026

Copy link
Copy Markdown
Author

@hamza221 , @SebastianKrupinski can you review this ?

@hamza221

Copy link
Copy Markdown
Contributor

CI is related, could you please take a look at that

@hamza221 hamza221 added enhancement New feature or request 3. to review Waiting for reviews 2. developing Work in progress and removed 3. to review Waiting for reviews labels Oct 20, 2026
@T0mWz
T0mWz requested a review from GVodyanov as a code owner October 21, 2026 13:04
@T0mWz

T0mWz commented Oct 22, 2026

Copy link
Copy Markdown
Author

@hamza221 @GVodyanov can you start the pipelines again for me to check if the unit tests now pass ? 😃

@T0mWz
T0mWz force-pushed the OCMinvitationMailTemplate branch 2 times, most recently from b5cbb89 to d7761e6 Compare October 22, 2026 08:31
@hamza221

Copy link
Copy Markdown
Contributor

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@hamza221 hamza221 added this to the v8.10.0 milestone Oct 22, 2026
@coderabbitai

coderabbitai Bot commented Oct 22, 2026

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
📥 Commits

Reviewing files that changed from the base of the PR and between a44197b and d7761e6.

📒 Files selected for processing: 2
  • lib/Controller/FederatedInvitesController.php
  • tests/unit/Controller/FederatedInvitesControllerTest.php

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

📝 Walkthrough

The federated invitation controller now builds email content with a mail template. Unit tests use a shared helper to capture the template-rendered HTML and text for invitation and resend cases.

Changes: Federated invitation email

Layer / File(s) Summary
Build invitation email with a template
lib/Controller/FederatedInvitesController.php, tests/unit/Controller/FederatedInvitesControllerTest.php
The controller sets the translated subject and attaches the invitation template with the initiator name, invite link, and message. Tests use a shared helper to capture rendered HTML and text for the relevant cases.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Merge Risk: ⚪ Minimal · up to d7761

The invitation email can use the new template without an identified merge-blocking issue.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title identifies the main change: using Nextcloud's default mail template for invitation emails. The wording is slightly awkward, but it is specific and related to the changeset.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@T0mWz
T0mWz force-pushed the OCMinvitationMailTemplate branch from d7761e6 to 478a4cf Compare October 22, 2026 08:39
tomwezepoel and others added 5 commits October 22, 2026 12:10
Signed-off-by: Tom Wezepoel <tom.wezepoel@surf.nl>
Signed-off-by: Tom Wezepoel <tom.wezepoel@surf.nl>
…view

Signed-off-by: silver <s.szmajduch@posteo.de>
Assisted-by: ClaudeCode:claude-opus-5.5
Signed-off-by: Tom Wezepoel <tom.wezepoel@surf.nl>
… creation

Signed-off-by: Roberto Guido <info@madbob.org>
Signed-off-by: Tom Wezepoel <tom.wezepoel@surf.nl>
Signed-off-by: hamza <hamzamahjoubi221@gmail.com>
Signed-off-by: Tom Wezepoel <tom.wezepoel@surf.nl>
nextcloud-bot and others added 3 commits October 22, 2026 12:10
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
Signed-off-by: Tom Wezepoel <tom.wezepoel@surf.nl>
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Tom Wezepoel <tom.wezepoel@surf.nl>
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
Signed-off-by: Tom Wezepoel <tom.wezepoel@surf.nl>
@T0mWz
T0mWz force-pushed the OCMinvitationMailTemplate branch from 478a4cf to 062cdca Compare October 22, 2026 10:11
@T0mWz

T0mWz commented Oct 22, 2026

Copy link
Copy Markdown
Author

Sorry, had some troubles with DCO, where I forgot the signoff on some commits. Hope that I have solved now everything. @hamza221 can you trigger the pipelines for me hopefully now really for the last time? 🙈

@hamza221

Copy link
Copy Markdown
Contributor

Sorry, had some troubles with DCO, where I forgot the signoff on some commits. Hope that I have solved now everything. @hamza221 can you trigger the pipelines for me hopefully now really for the last time? 🙈

I did but the commits need to be cleaned up, maybe a rebase on top of main would fix it

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2. developing Work in progress enhancement New feature or request feedback-requested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants