Basically, you have to set reply_to
parameter for message
I am not getting any shorter way...
Below code is not TESTED
First of all sales NEW ORDER EMAIL uses Mage_Core_Model_Email_Template_Mailer
which do not have setReplyTo
function, so you have to create it
public function setReplyTo($email){ //added
$this->setData('reply_to', $sender);
return $this;
}
Now have to pass additional parameter to sendTransactional
function of core/email_template
$emailTemplate->setDesignConfig(array('area' => 'frontend', 'store' => $this->getStoreId()))
->setQueue($this->getQueue())
->sendTransactional(
$this->getTemplateId(),
$this->getSender(),
$emailInfo->getToEmails(),
$emailInfo->getToNames(),
$this->getTemplateParams(),
$this->getStoreId(),
$this->getReplyTo() //added
);
As we have passed extra parameter to sendTransactional
we have to change that function
First extend Mage_Core_Model_Email_Template
in your local module add function
public function sendTransactional($templateId, $sender, $email, $name, $vars=array(), $storeId=null, $reply_to=null) // $reply_to added
{
$this->setSentSuccess(false);
if (($storeId === null) && $this->getDesignConfig()->getStore()) {
$storeId = $this->getDesignConfig()->getStore();
}
if (is_numeric($templateId)) {
$queue = $this->getQueue();
$this->load($templateId);
$this->setQueue($queue);
} else {
$localeCode = Mage::getStoreConfig('general/locale/code', $storeId);
$this->loadDefault($templateId, $localeCode);
}
if (!$this->getId()) {
throw Mage::exception('Mage_Core', Mage::helper('core')->__('Invalid transactional email code: %s', $templateId));
}
if (!is_array($sender)) {
$this->setSenderName(Mage::getStoreConfig('trans_email/ident_' . $sender . '/name', $storeId));
$this->setSenderEmail(Mage::getStoreConfig('trans_email/ident_' . $sender . '/email', $storeId));
} else {
$this->setSenderName($sender['name']);
$this->setSenderEmail($sender['email']);
}
if ($reply_to) { //added
$this->setSenderName($reply_to);
}
if (!isset($vars['store'])) {
$vars['store'] = Mage::app()->getStore($storeId);
}
$this->setSentSuccess($this->send($email, $name, $vars));
return $this;
}