Send permalink in internal share notification emails
This commit is contained in:
parent
112b703df0
commit
caefe23bb6
|
@ -119,27 +119,9 @@ class MailNotifications {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Link to folder, or root folder if a file
|
|
||||||
|
|
||||||
if ($itemType === 'folder') {
|
|
||||||
$args = array(
|
|
||||||
'dir' => $filename,
|
|
||||||
);
|
|
||||||
} else if (strpos($filename, '/')) {
|
|
||||||
$args = array(
|
|
||||||
'dir' => '/' . dirname($filename),
|
|
||||||
'scrollto' => basename($filename),
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
$args = array(
|
|
||||||
'dir' => '/',
|
|
||||||
'scrollto' => $filename,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
$link = $this->urlGenerator->linkToRouteAbsolute(
|
$link = $this->urlGenerator->linkToRouteAbsolute(
|
||||||
'files.view.index',
|
'files.viewcontroller.showFile',
|
||||||
$args
|
['fileId' => $items[0]['item_source']]
|
||||||
);
|
);
|
||||||
|
|
||||||
list($htmlBody, $textBody) = $this->createMailBody($filename, $link, $expiration, 'internal');
|
list($htmlBody, $textBody) = $this->createMailBody($filename, $link, $expiration, 'internal');
|
||||||
|
|
|
@ -222,7 +222,7 @@ class MailNotificationsTest extends \Test\TestCase {
|
||||||
$mailNotifications->method('getItemSharedWithUser')
|
$mailNotifications->method('getItemSharedWithUser')
|
||||||
->withAnyParameters()
|
->withAnyParameters()
|
||||||
->willReturn([
|
->willReturn([
|
||||||
['file_target' => '/welcome.txt']
|
['file_target' => '/welcome.txt', 'item_source' => 123],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$recipient = $this->getMockBuilder('\OCP\IUser')
|
$recipient = $this->getMockBuilder('\OCP\IUser')
|
||||||
|
@ -239,10 +239,9 @@ class MailNotificationsTest extends \Test\TestCase {
|
||||||
$this->urlGenerator->expects($this->once())
|
$this->urlGenerator->expects($this->once())
|
||||||
->method('linkToRouteAbsolute')
|
->method('linkToRouteAbsolute')
|
||||||
->with(
|
->with(
|
||||||
$this->equalTo('files.view.index'),
|
$this->equalTo('files.viewcontroller.showFile'),
|
||||||
$this->equalTo([
|
$this->equalTo([
|
||||||
'dir' => '/',
|
'fileId' => 123,
|
||||||
'scrollto' => 'welcome.txt'
|
|
||||||
])
|
])
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue