feat: Add route to open messages via Message-ID#12632
feat: Add route to open messages via Message-ID#12632SoleroTG wants to merge 2 commits intonextcloud:mainfrom
Conversation
Signed-off-by: SoleroTG <github-29h@solero.quietmail.eu>
Signed-off-by: SoleroTG <github-29h@solero.quietmail.eu>
4366c3a to
a38f75a
Compare
| declare(strict_types=1); | ||
|
|
||
| /** | ||
| * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors |
There was a problem hiding this comment.
| * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors | |
| * SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors |
| MailAccountMapper $mailAccountMapper, | ||
| AccountService $accountService, | ||
| MessageMapper $messageMapper, | ||
| IURLGenerator $urlGenerator, | ||
| IUserSession $userSession, | ||
| LoggerInterface $logger |
There was a problem hiding this comment.
| MailAccountMapper $mailAccountMapper, | |
| AccountService $accountService, | |
| MessageMapper $messageMapper, | |
| IURLGenerator $urlGenerator, | |
| IUserSession $userSession, | |
| LoggerInterface $logger | |
| private MailAccountMapper $mailAccountMapper, | |
| private AccountService $accountService, | |
| private MessageMapper $messageMapper, | |
| private IURLGenerator $urlGenerator, | |
| private IUserSession $userSession, | |
| private LoggerInterface $logger |
There was a problem hiding this comment.
Adding private/protected/public in a class constructor = shortcut to create a property with the given name and assign the value to it.
| private MailAccountMapper $mailAccountMapper; | ||
| private AccountService $accountService; | ||
| private MessageMapper $messageMapper; | ||
| private IURLGenerator $urlGenerator; | ||
| private IUserSession $userSession; | ||
| private LoggerInterface $logger; |
There was a problem hiding this comment.
| private MailAccountMapper $mailAccountMapper; | |
| private AccountService $accountService; | |
| private MessageMapper $messageMapper; | |
| private IURLGenerator $urlGenerator; | |
| private IUserSession $userSession; | |
| private LoggerInterface $logger; |
| $this->mailAccountMapper = $mailAccountMapper; | ||
| $this->accountService = $accountService; | ||
| $this->messageMapper = $messageMapper; | ||
| $this->urlGenerator = $urlGenerator; | ||
| $this->userSession = $userSession; | ||
| $this->logger = $logger; |
There was a problem hiding this comment.
| $this->mailAccountMapper = $mailAccountMapper; | |
| $this->accountService = $accountService; | |
| $this->messageMapper = $messageMapper; | |
| $this->urlGenerator = $urlGenerator; | |
| $this->userSession = $userSession; | |
| $this->logger = $logger; |
| /** | ||
| * @NoAdminRequired | ||
| * @NoCSRFRequired | ||
| * @PublicPage |
There was a problem hiding this comment.
| * @PublicPage |
|
|
||
| /** | ||
| * @NoAdminRequired | ||
| * @NoCSRFRequired |
There was a problem hiding this comment.
| * @NoCSRFRequired |
|
Thanks a lot for your pr, I will give it a test this week. |
|
Hello there, 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.) |
Related to #2269
Hi @ChristophWurst, this is the first part of the deep-linking feature.
What this PR does
This PR introduces a new frontend route
/apps/mail/open/<message-id>that allows opening a specific email directly if the Message-ID is known.The app will search for a message with the given ID across all accounts and mailboxes of the user and open it if found.
This is the foundational work for a future UI element that will allow users to copy such a link. The button for generating the link is not part of this PR and will follow in a separate one.
How to test
Message-IDof an existing email (e.g., from the email source).http://<your-nextcloud-instance>/index.php/apps/mail/open/<your-message-id>.<becomes%3C).