diff options
author | Joas Schilling <coding@schilljs.com> | 2017-06-13 12:19:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-13 12:19:41 +0200 |
commit | b7761be4d9a53c4a5cebff4caf37bd2b4af6ebb4 (patch) | |
tree | 32830dec5ce9c14c236888f56701ce39d9293a61 /apps | |
parent | c46422b780621d5ac700e7ca2f6ddf7b1386482f (diff) | |
parent | 1ef8ea5a7e5bfdbd9e5bea29ada3424df756b32a (diff) | |
download | nextcloud-server-b7761be4d9a53c4a5cebff4caf37bd2b4af6ebb4.tar.gz nextcloud-server-b7761be4d9a53c4a5cebff4caf37bd2b4af6ebb4.zip |
Merge pull request #5302 from nextcloud/fix_5047
use the email address configured in Nextcloud as sender instead of the users email address
Diffstat (limited to 'apps')
-rw-r--r-- | apps/sharebymail/lib/ShareByMailProvider.php | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/apps/sharebymail/lib/ShareByMailProvider.php b/apps/sharebymail/lib/ShareByMailProvider.php index 3bcd1512c41..f4db83ea3cf 100644 --- a/apps/sharebymail/lib/ShareByMailProvider.php +++ b/apps/sharebymail/lib/ShareByMailProvider.php @@ -456,11 +456,24 @@ class ShareByMailProvider implements IShareProvider { $emailTemplate->addHeading($this->l->t('Password to access »%s«', [$filename]), false); $emailTemplate->addBodyText($htmlBodyPart, $plainBodyPart); $emailTemplate->addBodyText($this->l->t('It is protected with the following password: %s', [$password])); - $emailTemplate->addFooter(); + // The "From" contains the sharers name + $instanceName = $this->defaults->getName(); + $senderName = $this->l->t( + '%s via %s', + [ + $initiatorDisplayName, + $instanceName + ] + ); + $message->setFrom([\OCP\Util::getDefaultEmailAddress($instanceName) => $senderName]); if ($initiatorEmailAddress !== null) { - $message->setFrom([$initiatorEmailAddress => $initiatorDisplayName]); + $message->setReplyTo([$initiatorEmailAddress => $initiatorDisplayName]); + $emailTemplate->addFooter($instanceName . ' - ' . $this->defaults->getSlogan()); + } else { + $emailTemplate->addFooter(); } + $message->setTo([$shareWith]); $message->setSubject($subject); $message->setBody($emailTemplate->renderText(), 'text/plain'); |