public function enhanceMail(Codendi_Mail $mail) { $headers = $this->getAdditionalHeaders(); $from_mail = null; if (array_key_exists('from', $headers)) { $from_mail = $headers['from']; unset($headers['from']); } if ($from_mail === null && array_key_exists('reply-to', $headers)) { $from_mail = $headers['reply-to']; } if ($from_mail !== null) { $mail->clearFrom(); $mail->setFrom($from_mail); } foreach ($headers as $name => $value) { $mail->addAdditionalHeader($name, $value); } foreach ($this->getAdditionalPropertiesForLookAndFeel() as $property => $value) { $mail->getLookAndFeelTemplate()->set($property, $value); } if ($this->getMessageId()) { $mail->getMail()->setMessageId($this->getMessageId()); } }