Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions apps/files_sharing/lib/Service/NotificationPublisher.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
*/
namespace OCA\Files_Sharing\Service;

use OCP\BackgroundJob\IJobList;
use OCP\IURLGenerator;
use OCP\IUserManager;
use OCP\IGroupManager;
Expand Down Expand Up @@ -117,6 +118,12 @@ public function sendNotification(IShare $share) {

$this->notificationManager->notify($notification);
}

/**
* Finally notify users via email This task would run
* as a background job.
*/
$this->notificationManager->emailNotify($share->getFullId());
}

/**
Expand Down
10 changes: 10 additions & 0 deletions lib/private/Notification/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,16 @@ public function notify(INotification $notification) {
}
}

/**
* @param string $shareFullId
* @return null
*/
public function emailNotify($shareFullId) {
foreach ($this->getApps() as $app) {
$app->emailNotify($shareFullId);
}
}

/**
* @param INotification $notification
* @param string $languageCode The code of the language that should be used to prepare the notification
Expand Down
8 changes: 8 additions & 0 deletions lib/public/Notification/IApp.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,12 @@ public function markProcessed(INotification $notification);
* @since 9.0.0
*/
public function getCount(INotification $notification);

/**
* Notification of a share to user(s) by email is achieved by background job
* @param string $shareFullId
* @return null
* @since 10.1.0
*/
public function emailNotify($shareFullId);
}
7 changes: 7 additions & 0 deletions lib/public/Notification/IManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,11 @@ public function createNotification();
* @since 9.0.0
*/
public function hasNotifiers();

/**
* @param string $shareFullId
* @return null
* @since 10.1.0
*/
public function emailNotify($shareFullId);
}