From 43d66661e879bc7bfd888917227fb2707ab978fb Mon Sep 17 00:00:00 2001 From: SebastianKrupinski Date: Fri, 7 Jun 2024 08:48:09 -0400 Subject: [PATCH] feature: mail provider backend Signed-off-by: SebastianKrupinski --- apps/dav/lib/CalDAV/Schedule/IMipPlugin.php | 6 ++++-- lib/private/AppFramework/Bootstrap/RegistrationContext.php | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php b/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php index af3e87c395f94..71e7ed8b167b2 100644 --- a/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php +++ b/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php @@ -16,6 +16,7 @@ use OCP\IConfig; use OCP\IUserSession; use OCP\Mail\IMailer; +use OCP\Mail\Provider\IMessageSend; use OCP\Util; use Psr\Log\LoggerInterface; use Sabre\CalDAV\Schedule\IMipPlugin as SabreIMipPlugin; @@ -263,7 +264,7 @@ public function schedule(Message $iTipMessage) { // retrieve all services $mailService = $mailManager->findServiceByAddress($this->userSession->getUser()->getUID(), $sender); // evaluate if a mail service was found and has sending capabilities - if ($mailService !== null && $mailService->capable('MessageSend')) { + if ($mailService !== null && $mailService instanceof IMessageSend) { // construct mail provider message and set required parameters $message = new \OCP\Mail\Provider\Message(); $message->setFrom( @@ -281,7 +282,8 @@ public function schedule(Message $iTipMessage) { 'text/calendar; method=' . $iTipMessage->method, true ))); - $failed = $mailService->messageSend($message); + // send message + $mailService->messageSend($message); } else { // construct symfony mailer message and set required parameters $message = $this->mailer->createMessage(); diff --git a/lib/private/AppFramework/Bootstrap/RegistrationContext.php b/lib/private/AppFramework/Bootstrap/RegistrationContext.php index ac3806455c361..f59d5b557064b 100644 --- a/lib/private/AppFramework/Bootstrap/RegistrationContext.php +++ b/lib/private/AppFramework/Bootstrap/RegistrationContext.php @@ -416,10 +416,10 @@ public function registerTaskProcessingTaskType(string $taskProcessingTaskTypeCla ); } - public function registerMailProvider(string $mailProviderClass): void { + public function registerMailProvider(string $class): void { $this->context->registerMailProvider( $this->appId, - $mailProviderClass + $class ); } };