diff --git a/modules/smtp/modules.php b/modules/smtp/modules.php index 5142ce3e3..6f08e509a 100644 --- a/modules/smtp/modules.php +++ b/modules/smtp/modules.php @@ -797,6 +797,19 @@ public function process() } } +/** + * Determine if composer_from is set + * @subpackage smtp/handler + */ +class Hm_Handler_smtp_subject_replace extends Hm_Handler_Module { + public function process() + { + if (array_key_exists('compose_subject', $this->request->get)) { + $this->out('compose_subject', $this->request->get['compose_subject']); + } + } +} + /** * Determine if auto-bcc is active * @subpackage smtp/handler @@ -1020,7 +1033,6 @@ protected function output() { class Hm_Output_compose_form_content extends Hm_Output_Module { protected function output() { $to = ''; - $subject = ''; $body = ''; $files = $this->get('uploaded_files', array()); $cc = ''; @@ -1036,6 +1048,7 @@ protected function output() { $msg_path = $this->get('list_path', ''); $msg_uid = $this->get('uid', ''); $from = $this->get('compose_from'); + $subject = $this->get('compose_subject'); $forward_as_attachment=$this->get('as_attr'); if (!$msg_path) { diff --git a/modules/smtp/setup.php b/modules/smtp/setup.php index 916bf9e61..8d1cb62fb 100644 --- a/modules/smtp/setup.php +++ b/modules/smtp/setup.php @@ -9,6 +9,7 @@ add_handler('compose', 'load_smtp_reply_to_details', true, 'smtp', 'load_user_data', 'after'); add_handler('compose', 'load_smtp_is_imap_draft', true, 'smtp', 'load_user_data', 'after'); add_handler('compose', 'smtp_from_replace', true, 'smtp', 'load_user_data', 'after'); +add_handler('compose', 'smtp_subject_replace', true, 'smtp', 'load_user_data', 'after'); add_handler('compose', 'load_smtp_servers_from_config', true, 'smtp', 'load_smtp_reply_to_details', 'after'); add_handler('compose', 'add_smtp_servers_to_page_data', true, 'smtp', 'load_smtp_servers_from_config', 'after'); add_handler('compose', 'process_compose_form_submit', true, 'smtp', 'load_smtp_servers_from_config', 'after'); @@ -125,6 +126,7 @@ 'compose_to' => FILTER_DEFAULT, 'mailto_uri' => FILTER_DEFAULT, 'compose_from' => FILTER_DEFAULT, + 'compose_subject' => FILTER_DEFAULT, 'resumableChunkNumber' => FILTER_VALIDATE_INT, 'resumableTotalChunks' => FILTER_VALIDATE_INT, 'resumableChunkSize' => FILTER_VALIDATE_INT,