summaryrefslogtreecommitdiffstats
path: root/lib/private/mail.php
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2015-04-12 22:54:29 +0200
committerLukas Reschke <lukas@owncloud.com>2015-04-12 23:03:32 +0200
commite6c2382a19bd6dbf7bb8e9721251a96f0584ee17 (patch)
tree9732a2f749df28b97addc1687cef2f5cedd2b86d /lib/private/mail.php
parent43b2f3c2dc76caadb1a32d6341fa24a39083d8fb (diff)
downloadnextcloud-server-e6c2382a19bd6dbf7bb8e9721251a96f0584ee17.tar.gz
nextcloud-server-e6c2382a19bd6dbf7bb8e9721251a96f0584ee17.zip
Add "Reply-To" support for sharing notifications
Very hacky backport of https://github.com/owncloud/core/pull/15541 - I changed the code path to use OC_Mail instead the OCP pendant since I didn't want to modify the public API. (OCP\Util::sendMail() is anyways deprecated with 8.1)
Diffstat (limited to 'lib/private/mail.php')
-rw-r--r--lib/private/mail.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/private/mail.php b/lib/private/mail.php
index 6043532420b..727b0df06f8 100644
--- a/lib/private/mail.php
+++ b/lib/private/mail.php
@@ -28,10 +28,11 @@ class OC_Mail {
* @param string $ccaddress
* @param string $ccname
* @param string $bcc
+ * @param string $replyTo
* @throws Exception
*/
public static function send($toaddress, $toname, $subject, $mailtext, $fromaddress, $fromname,
- $html=0, $altbody='', $ccaddress='', $ccname='', $bcc='') {
+ $html=0, $altbody='', $ccaddress='', $ccname='', $bcc='', $replyTo='') {
$SMTPMODE = OC_Config::getValue( 'mail_smtpmode', 'sendmail' );
$SMTPHOST = OC_Config::getValue( 'mail_smtphost', '127.0.0.1' );
@@ -78,7 +79,9 @@ class OC_Mail {
if($ccaddress<>'') $mailo->AddCC($ccaddress, $ccname);
if($bcc<>'') $mailo->AddBCC($bcc);
- $mailo->AddReplyTo($fromaddress, $fromname);
+ if($replyTo !== '') {
+ $mailo->addReplyTo($replyTo);
+ }
$mailo->WordWrap = 50;
if($html==1) $mailo->IsHTML(true); else $mailo->IsHTML(false);