Commit 87f24955 by Dirk Benkert

added expiration date of shared folder to notification email

parent 091bd291
......@@ -117,7 +117,7 @@ class User extends AbstractService {
$this->getEntityManager()->persist($folder);
$this->getEntityManager()->flush();
$this->sendInvites($existingUsers, $newUsers);
$this->sendInvites($existingUsers, $newUsers, $folder);
}
/**
......@@ -126,7 +126,7 @@ class User extends AbstractService {
* @param array $oldUserList
* @param array $newUserList
*/
public function sendInvites($oldUserList, $newUserList) {
public function sendInvites($oldUserList, $newUserList, $folder) {
$notificationService = new NotificationEmail('invite', $this->getServiceLocator());
$userIds = array_keys($newUserList);
......@@ -138,7 +138,7 @@ class User extends AbstractService {
foreach ($newUserList as $invitee) {
$notificationService->addRecipient($invitee['email']);
$notificationService->setData($this->getData($invitee));
$notificationService->setData($this->getData($invitee, $folder));
$notificationService->send();
}
}
......@@ -150,7 +150,7 @@ class User extends AbstractService {
*
* @return array
*/
public function getData($invitee) {
public function getData($invitee, $folder) {
$text = 'Use ' . $invitee['email'] . ' to login.';
$authService = $this->getServiceLocator()->get('Zend\Authentication\AuthenticationService');
......@@ -160,6 +160,8 @@ class User extends AbstractService {
$text .= PHP_EOL . 'Password: ' . $invitee['password'];
}
$text .= PHP_EOL . PHP_EOL . 'The share is valid until ' . $folder->expires->format('d.m.Y');
return array(
'invitor' => $identity->email,
'text' => $text,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment