diff --git a/core/templates/internalaltmail.php b/core/templates/internalaltmail.php new file mode 100644 index 0000000000..38531d109b --- /dev/null +++ b/core/templates/internalaltmail.php @@ -0,0 +1,13 @@ +t("Hey there,\n\njust letting you know that %s shared %s with you.\nView it: %s\n\n", array($_['user_displayname'], $_['filename'], $_['link']))); +if ( isset($_['expiration']) ) { + print_unescaped($l->t("The share will expire on %s.", array($_['expiration']))); + print_unescaped("\n\n"); +} +// TRANSLATORS term at the end of a mail +p($l->t("Cheers!")); +?> + +-- +getName() . ' - ' . $theme->getSlogan()); ?> +getBaseUrl()); diff --git a/core/templates/internalmail.php b/core/templates/internalmail.php new file mode 100644 index 0000000000..0e73a60185 --- /dev/null +++ b/core/templates/internalmail.php @@ -0,0 +1,39 @@ + + +
+ + + + + + + + + + + + + + + + + + +
  +<?php p($theme->getName()); ?> +
 
  +t('Hey there,

just letting you know that %s shared %s with you.
View it!

', array($_['user_displayname'], $_['filename'], $_['link']))); +if ( isset($_['expiration']) ) { + p($l->t("The share will expire on %s.", array($_['expiration']))); + print_unescaped('

'); +} +// TRANSLATORS term at the end of a mail +p($l->t('Cheers!')); +?> +
 
 --
+getName()); ?> - +getSlogan()); ?> +
getBaseUrl());?> +
 
+
diff --git a/lib/private/share/mailnotifications.php b/lib/private/share/mailnotifications.php index 8056260bf1..2797e5ed99 100644 --- a/lib/private/share/mailnotifications.php +++ b/lib/private/share/mailnotifications.php @@ -136,7 +136,7 @@ class MailNotifications { $link = \OCP\Util::linkToAbsolute('files', 'index.php', $args); - list($htmlBody, $textBody) = $this->createMailBody($filename, $link, $expiration); + list($htmlBody, $textBody) = $this->createMailBody($filename, $link, $expiration, 'internal'); // send it out now try { @@ -210,20 +210,20 @@ class MailNotifications { * @param string $filename the shared file * @param string $link link to the shared file * @param int $expiration expiration date (timestamp) + * @param bool $prefix prefix of mail template files * @return array an array of the html mail body and the plain text mail body */ - private function createMailBody($filename, $link, $expiration) { - + private function createMailBody($filename, $link, $expiration, $prefix = '') { $formattedDate = $expiration ? $this->l->l('date', $expiration) : null; - $html = new \OC_Template("core", "mail", ""); + $html = new \OC_Template('core', $prefix . 'mail', ''); $html->assign ('link', $link); $html->assign ('user_displayname', $this->senderDisplayName); $html->assign ('filename', $filename); $html->assign('expiration', $formattedDate); $htmlMail = $html->fetchPage(); - $plainText = new \OC_Template("core", "altmail", ""); + $plainText = new \OC_Template('core', $prefix . 'altmail', ''); $plainText->assign ('link', $link); $plainText->assign ('user_displayname', $this->senderDisplayName); $plainText->assign ('filename', $filename);