$l = OC_L10N::get('core');
// setup the email
- $subject = (string)$l->t('User %s shared a file with you', $displayName);
- if ($type === 'folder')
- $subject = (string)$l->t('User %s shared a folder with you', $displayName);
+ $subject = (string)$l->t('%s shared »%s« with you', array($displayName, $file));
- $text = (string)$l->t('User %s shared the file "%s" with you. It is available for download here: %s',
- array($displayName, $file, $link));
- if ($type === 'folder')
- $text = (string)$l->t('User %s shared the folder "%s" with you. It is available for download here: %s',
- array($displayName, $file, $link));
+ $content = new OC_Template("core", "mail", "");
+ $content->assign ('link', $link);
+ $content->assign ('type', $type);
+ $content->assign ('user_displayname', $displayName);
+ $content->assign ('filename', $file);
+ $text = $content->fetchPage();
+ $content = new OC_Template("core", "altmail", "");
+ $content->assign ('link', $link);
+ $content->assign ('type', $type);
+ $content->assign ('user_displayname', $displayName);
+ $content->assign ('filename', $file);
+ $alttext = $content->fetchPage();
$default_from = OCP\Util::getDefaultEmailAddress('sharing-noreply');
$from_address = OCP\Config::getUserValue($user, 'settings', 'email', $default_from );
// send it out now
try {
- OCP\Util::sendMail($to_address, $to_address, $subject, $text, $from_address, $displayName);
+ OCP\Util::sendMail($to_address, $to_address, $subject, $text, $from_address, $displayName, 1, $alttext);
OCP\JSON::success();
} catch (Exception $exception) {
OCP\JSON::error(array('data' => array('message' => OC_Util::sanitizeHTML($exception->getMessage()))));
--- /dev/null
+<table cellspacing="0" cellpadding="0" border="0" width="100%">
+<tr><td>
+<table cellspacing="0" cellpadding="0" border="0" width="600px">
+<tr>
+<td bgcolor="#1d2d44" width="20px"> </td>
+<td bgcolor="#1d2d44">
+<img src="<?php print_unescaped(OC_Helper::makeURLAbsolute(image_path('', 'logo-mail.gif'))); ?>" alt="ownCloud"/>
+</td>
+</tr>
+<tr><td bgcolor="#f8f8f8" colspan="2"> </td></tr>
+<tr>
+<td bgcolor="#f8f8f8" width="20px"> </td>
+<td bgcolor="#f8f8f8" style="font-weight:normal; font-size:0.8em; line-height:1.2em; font-family:verdana,'arial',sans;">
+<?php
+print_unescaped($l->t('Hey there,<br><br>just letting you know that %s shared »%s« with you.<br><a href="%s">View it!</a><br><br>Cheers!', array($_['user_displayname'], $_['filename'], $_['link'])));
+?>
+</td>
+</tr>
+<tr><td bgcolor="#f8f8f8" colspan="2"> </td></tr>
+<tr>
+<td bgcolor="#f8f8f8" width="20px"> </td>
+<td bgcolor="#f8f8f8" style="font-weight:normal; font-size:0.8em; line-height:1.2em; font-family:verdana,'arial',sans;">--<br>
+<?php
+print_unescaped($l->t('ownCloud - web services under your control'));
+?>
+<br><a href="http://owncloud.org">http://ownCloud.org</a></td>
+</tr>
+<tr>
+<td bgcolor="#f8f8f8" colspan="2"> </td>
+</tr>
+</table>
+</td></tr>
+</table>