Skip to content

Commit

Permalink
Reply to email
Browse files Browse the repository at this point in the history
  • Loading branch information
Nilesh More committed Jul 4, 2016
1 parent 06d6640 commit f07da9f
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 8 deletions.
19 changes: 19 additions & 0 deletions administrator/components/com_config/model/form/application.xml
Expand Up @@ -459,6 +459,25 @@
showon="mailonline:1"
/>

<field
name="replyto"
type="email"
label="COM_CONFIG_FIELD_MAIL_REPLY_TO_EMAIL_LABEL"
description="COM_CONFIG_FIELD_MAIL_REPLY_TO_EMAIL_DESC"
filter="string"
size="30"
validate="email"
/>

<field
name="replytoname"
type="text"
label="COM_CONFIG_FIELD_MAIL_REPLY_TO_NAME_LABEL"
description="COM_CONFIG_FIELD_MAIL_REPLY_TO_NAME_DESC"
filter="string"
size="30"
/>

<field
name="mailer"
type="list"
Expand Down
4 changes: 4 additions & 0 deletions administrator/language/en-GB/en-GB.com_config.ini
Expand Up @@ -105,6 +105,10 @@ COM_CONFIG_FIELD_MAIL_FROM_EMAIL_DESC="The email address that will be used to se
COM_CONFIG_FIELD_MAIL_FROM_EMAIL_LABEL="From email"
COM_CONFIG_FIELD_MAIL_FROM_NAME_DESC="Text displayed in the header &quot;From:&quot; field when sending a site email. Usually the site name."
COM_CONFIG_FIELD_MAIL_FROM_NAME_LABEL="From Name"
COM_CONFIG_FIELD_MAIL_REPLY_TO_EMAIL_LABEL="Reply To"
COM_CONFIG_FIELD_MAIL_REPLY_TO_EMAIL_DESC="The email address that will be used to receive end user(s) reply"
COM_CONFIG_FIELD_MAIL_REPLY_TO_NAME_LABEL="Reply To name"
COM_CONFIG_FIELD_MAIL_REPLY_TO_NAME_DESC="Text displayed in the header &quot;To:&quot; field when end user(s) replying to received email"
COM_CONFIG_FIELD_MAIL_MAILONLINE_DESC="Select Yes to turn on mail sending, select No to turn off mail sending. Warning: It is advised to put the site offline when disabling the mail function!"
COM_CONFIG_FIELD_MAIL_MAILONLINE_LABEL="Send Mail"
COM_CONFIG_FIELD_MAIL_MASSMAILOFF_DESC="Select Yes to disable the Mass Mail Users function, select No to make it active."
Expand Down
18 changes: 10 additions & 8 deletions installation/configuration.php-dist
Expand Up @@ -60,14 +60,16 @@ class JConfig {
public $session_handler = 'database';

/* Mail Settings */
public $mailer = 'mail';
public $mailfrom = '';
public $fromname = '';
public $sendmail = '/usr/sbin/sendmail';
public $smtpauth = '0';
public $smtpuser = '';
public $smtppass = '';
public $smtphost = 'localhost';
public $mailer = 'mail';
public $mailfrom = '';
public $fromname = '';
public $replyTo = '';
public $replytoname = '';
public $sendmail = '/usr/sbin/sendmail';
public $smtpauth = '0';
public $smtpuser = '';
public $smtppass = '';
public $smtphost = 'localhost';

/* Cache Settings */
public $caching = '0';
Expand Down
7 changes: 7 additions & 0 deletions libraries/joomla/mail/mail.php
Expand Up @@ -672,6 +672,9 @@ public function useSmtp($auth = null, $host = null, $user = null, $pass = null,
public function sendMail($from, $fromName, $recipient, $subject, $body, $mode = false, $cc = null, $bcc = null, $attachment = null,
$replyTo = null, $replyToName = null)
{
// Create config object
$config = JFactory::getConfig();

$this->setSubject($subject);
$this->setBody($body);

Expand Down Expand Up @@ -722,6 +725,10 @@ public function sendMail($from, $fromName, $recipient, $subject, $body, $mode =
return false;
}
}
elseif ($config->get('replyto'))
{
$this->addReplyTo($config->get('replyto'), $config->get('replytoname'));
}

// Add sender to replyTo only if no replyTo received
$autoReplyTo = (empty($this->ReplyTo)) ? true : false;
Expand Down

0 comments on commit f07da9f

Please sign in to comment.