Skip to content

Commit

Permalink
Merge pull request #1312 from josaphatim/added-possibility-to-pass-su…
Browse files Browse the repository at this point in the history
…bject-in-url

Add possibility to pass compose subject in url
  • Loading branch information
Shadow243 authored Dec 17, 2024
2 parents fa76a36 + cc016b2 commit 93d9c95
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 14 additions & 1 deletion modules/smtp/modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 = '';
Expand All @@ -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) {
Expand Down
2 changes: 2 additions & 0 deletions modules/smtp/setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 93d9c95

Please sign in to comment.