summaryrefslogtreecommitdiffstats
path: root/apps/sharebymail/lib
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-08-26 18:53:52 +0200
committerGitHub <noreply@github.com>2017-08-26 18:53:52 +0200
commit2bf15eda2610b2a06dabe3f3b6ae0675a9980ec4 (patch)
tree79118c39f031e8bbbf2f18ad295a1b19bf01b72d /apps/sharebymail/lib
parent0b652648cc698d3b5c2979ccb7f1d1544057294d (diff)
parentf0c34a3e89907cab471dcc35b9eebae8d60ca598 (diff)
downloadnextcloud-server-2bf15eda2610b2a06dabe3f3b6ae0675a9980ec4.tar.gz
nextcloud-server-2bf15eda2610b2a06dabe3f3b6ae0675a9980ec4.zip
Merge pull request #6255 from nextcloud/email-meta-data
Add meta information to emails for better customisation
Diffstat (limited to 'apps/sharebymail/lib')
-rw-r--r--apps/sharebymail/lib/ShareByMailProvider.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/apps/sharebymail/lib/ShareByMailProvider.php b/apps/sharebymail/lib/ShareByMailProvider.php
index 32fa51d94a2..836f230290c 100644
--- a/apps/sharebymail/lib/ShareByMailProvider.php
+++ b/apps/sharebymail/lib/ShareByMailProvider.php
@@ -347,7 +347,8 @@ class ShareByMailProvider implements IShareProvider {
$share->getNode()->getName(),
$link,
$share->getSharedBy(),
- $share->getSharedWith()
+ $share->getSharedWith(),
+ $share->getExpirationDate()
);
} catch (HintException $hintException) {
$this->logger->error('Failed to send share by mail: ' . $hintException->getMessage());
@@ -369,12 +370,14 @@ class ShareByMailProvider implements IShareProvider {
* @param string $link
* @param string $initiator
* @param string $shareWith
+ * @param \DateTime|null $expiration
* @throws \Exception If mail couldn't be sent
*/
protected function sendMailNotification($filename,
$link,
$initiator,
- $shareWith) {
+ $shareWith,
+ $expiration) {
$initiatorUser = $this->userManager->get($initiator);
$initiatorDisplayName = ($initiatorUser instanceof IUser) ? $initiatorUser->getDisplayName() : $initiator;
$subject = (string)$this->l->t('%s shared »%s« with you', array($initiatorDisplayName, $filename));
@@ -382,6 +385,12 @@ class ShareByMailProvider implements IShareProvider {
$message = $this->mailer->createMessage();
$emailTemplate = $this->mailer->createEMailTemplate();
+ $emailTemplate->setMetaData('sharebymail.RecipientNotification', [
+ 'filename' => $filename,
+ 'link' => $link,
+ 'initiator' => $initiatorDisplayName,
+ 'expiration' => $expiration,
+ ]);
$emailTemplate->addHeader();
$emailTemplate->addHeading($this->l->t('%s shared »%s« with you', [$initiatorDisplayName, $filename]), false);