summaryrefslogtreecommitdiffstats
path: root/apps/sharebymail/lib
diff options
context:
space:
mode:
authorBjoern Schiessle <bjoern@schiessle.org>2017-06-08 11:46:52 +0200
committerBjoern Schiessle <bjoern@schiessle.org>2017-06-08 11:46:52 +0200
commit1ef8ea5a7e5bfdbd9e5bea29ada3424df756b32a (patch)
tree5bd34ee062157a7f17dd93a4fdccf83f226a60c3 /apps/sharebymail/lib
parenta74901fce17da6d88dbb82373fff523b834d692d (diff)
downloadnextcloud-server-1ef8ea5a7e5bfdbd9e5bea29ada3424df756b32a.tar.gz
nextcloud-server-1ef8ea5a7e5bfdbd9e5bea29ada3424df756b32a.zip
use the email address configured in Nextcloud as sender instead of the users email address
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'apps/sharebymail/lib')
-rw-r--r--apps/sharebymail/lib/ShareByMailProvider.php17
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');