View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0012830 | mantisbt | plug-ins | public | 2011-03-01 08:20 | 2025-01-20 11:52 |
Reporter | barnabas.sudy | Assigned To | |||
Priority | normal | Severity | feature | Reproducibility | have not tried |
Status | new | Resolution | open | ||
Product Version | 1.2.4 | ||||
Summary | 0012830: new HTMLMail plugin v0.1 | ||||
Description | I'm working on a new HTMLMail plugin. The plugin is able to replace the content of the normal Mantis mail. | ||||
Additional Information | For using you need to patch the mantis and install the plugin. | ||||
Tags | attachments, custom, email, html, HTMLmail, patch, plugin, template | ||||
Attached Files | mantis-1.2.5-patch-for-htmlmail-0.1.patch (5,423 bytes)
--- core/email_api.php Thu Jan 15 09:14:12 1970 +++ core/email_api.php Thu Jan 15 09:14:12 1970 @@ -447,7 +447,8 @@ # Send signup email regardless of mail notification pref # or else users won't be able to sign up if( !is_blank( $t_email ) ) { - email_store( $t_email, $t_subject, $t_message ); + $t_params = array('admin_name' => $p_admin_name, 'user_id' => $p_user_id, 'confirm_hash' => $p_confirm_hash); + email_store( 'email_notification_signup', $t_email, $t_subject, $t_message, null, $t_params ); log_event( LOG_EMAIL, sprintf( 'Signup Email = %s, Hash = %s, User = @U%d', $t_email, $p_confirm_hash, $p_user_id ) ); if( OFF == config_get( 'email_send_using_cronjob' ) ) { @@ -483,7 +484,8 @@ # Send password reset regardless of mail notification prefs # or else users won't be able to receive their reset pws if( !is_blank( $t_email ) ) { - email_store( $t_email, $t_subject, $t_message ); + $t_params = array('user_id' => $p_user_id, 'confirm_hash' => $p_confirm_hash); + email_store('email_notification_forgotten_password', $t_email, $t_subject, $t_message, null, $t_params ); log_event( LOG_EMAIL, sprintf( 'Password reset for email = %s', $t_email ) ); if( OFF == config_get( 'email_send_using_cronjob' ) ) { @@ -515,7 +517,7 @@ $t_message = lang_get( 'new_account_signup_msg' ) . "\n\n" . lang_get( 'new_account_username' ) . ' ' . $p_username . "\n" . lang_get( 'new_account_email' ) . ' ' . $p_email . "\n" . lang_get( 'new_account_IP' ) . ' ' . $_SERVER["REMOTE_ADDR"] . "\n" . $g_path . "\n\n" . lang_get( 'new_account_do_not_reply' ); if( !is_blank( $t_recipient_email ) ) { - email_store( $t_recipient_email, $t_subject, $t_message ); + email_store( 'email_notification_new_account', $t_recipient_email, $t_subject, $t_message ); log_event( LOG_EMAIL, sprintf( 'New Account Notify for email = \'%s\'', $t_recipient_email ) ); if( OFF == config_get( 'email_send_using_cronjob' ) ) { @@ -781,7 +783,7 @@ * @param array $p_headers * @return int */ -function email_store( $p_recipient, $p_subject, $p_message, $p_headers = null ) { +function email_store( $p_message_id, $p_recipient, $p_subject, $p_message, $p_headers = null, $p_params = null ) { $t_recipient = trim( $p_recipient ); $t_subject = string_email( trim( $p_subject ) ); $t_message = string_email_links( trim( $p_message ) ); @@ -817,6 +819,8 @@ } $t_email_data->metadata['hostname'] = $t_hostname; + $t_email_data = event_signal('EVENT_NOTIFY_EMAIL', $t_email_data, array( 'message_id' => $p_message_id, 'params' => $p_params,)); + $t_email_id = email_queue_add( $t_email_data ); return $t_email_id; @@ -930,7 +934,7 @@ break; } - $mail->IsHTML( false ); # set email format to plain text + $mail->IsHTML ( isset( $t_email_data->metadata['Content-Type'] ) && stripos( $t_email_data->metadata['Content-Type'], "text/html" ) !== false ) ; # set email format to plain text $mail->WordWrap = 80; # set word wrap to 50 characters $mail->Priority = $t_email_data->metadata['priority']; # Urgent = 1, Not Urgent = 5, Disable = 0 $mail->CharSet = $t_email_data->metadata['charset']; @@ -1126,8 +1130,10 @@ $t_header = "\n" . lang_get( 'on_date' ) . " $t_date, $t_sender $t_sender_email " . lang_get( 'sent_you_this_reminder_about' ) . ": \n\n"; $t_contents = $t_header . string_get_bug_view_url_with_fqdn( $p_bug_id, $t_recipient ) . " \n\n$p_message"; + $t_params = array( 'message' => $p_message, 'bug_id' => $p_bug_id, 'recipient' => $t_recipient, 'sender' => $t_sender, 'sender_email' => $t_sender_email ); + if( ON == config_get( 'enable_email_notification' ) ) { - email_store( $t_email, $t_subject, $t_contents ); + email_store( 'email_bug_reminder', $t_email, $t_subject, $t_contents, null, $t_params ); } lang_pop(); @@ -1189,7 +1195,7 @@ } # send mail - $t_ok = email_store( $t_user_email, $t_subject, $t_message, $t_mail_headers ); + $t_ok = email_store( $p_message_id, $t_user_email, $t_subject, $t_message, $t_mail_headers, array_merge($p_visible_bug_data, array('header_optional_params' => $p_header_optional_params))); return $t_ok; } --- core/events_inc.php Thu Jan 15 09:14:12 1970 +++ core/events_inc.php Thu Jan 15 09:14:12 1970 @@ -108,6 +108,7 @@ # Email notification events 'EVENT_NOTIFY_USER_INCLUDE' => EVENT_TYPE_DEFAULT, 'EVENT_NOTIFY_USER_EXCLUDE' => EVENT_TYPE_DEFAULT, + 'EVENT_NOTIFY_EMAIL' => EVENT_TYPE_CHAIN, # Wiki events 'EVENT_WIKI_INIT' => EVENT_TYPE_FIRST, --- manage_user_update.php Thu Jan 15 09:14:12 1970 +++ manage_user_update.php Thu Jan 15 09:14:12 1970 @@ -164,7 +164,7 @@ $t_subject = '[' . config_get( 'window_title' ) . '] ' . lang_get( 'email_user_updated_subject' ); $t_updated_msg = lang_get( 'email_user_updated_msg' ); $t_message = $t_updated_msg . "\n\n" . config_get( 'path' ) . 'account_page.php' . "\n\n" . $t_changes; - email_store( $t_email, $t_subject, $t_message ); + email_store( 'email_notification_user_update', $t_email, $t_subject, $t_message, null, array( 'changes' => $t_changes ) ); log_event( LOG_EMAIL, sprintf( 'Account update notification sent to ' . $f_username . ' (' . $t_email . ')' ) ); if ( config_get( 'email_send_using_cronjob' ) == OFF ) { email_send_all(); 01-1.2.7-patch-to-use-HTMLMail-0.1.patch (7,349 bytes)
Index: core/email_api.php =================================================================== --- a/core/email_api.php +++ b/core/email_api.php @@ -447,7 +447,8 @@ function email_signup( $p_user_id, $p_password, $p_confirm_hash, $p_admin_name = # Send signup email regardless of mail notification pref # or else users won't be able to sign up if( !is_blank( $t_email ) ) { - email_store( $t_email, $t_subject, $t_message ); + $t_params = array( 'admin_name' => $p_admin_name, 'user_id' => $p_user_id, 'confirm_hash' => $p_confirm_hash ); + email_store( 'email_notification_signup', $t_email, $t_subject, $t_message, null, $t_params ); log_event( LOG_EMAIL, sprintf( 'Signup Email = %s, Hash = %s, User = @U%d', $t_email, $p_confirm_hash, $p_user_id ) ); if( OFF == config_get( 'email_send_using_cronjob' ) ) { @@ -483,7 +484,8 @@ function email_send_confirm_hash_url( $p_user_id, $p_confirm_hash ) { # Send password reset regardless of mail notification prefs # or else users won't be able to receive their reset pws if( !is_blank( $t_email ) ) { - email_store( $t_email, $t_subject, $t_message ); + $t_params = array( 'user_id' => $p_user_id, 'confirm_hash' => $p_confirm_hash ); + email_store( 'email_notification_forgotten_password', $t_email, $t_subject, $t_message, null, $t_params ); log_event( LOG_EMAIL, sprintf( 'Password reset for email = %s', $t_email ) ); if( OFF == config_get( 'email_send_using_cronjob' ) ) { @@ -515,7 +517,7 @@ function email_notify_new_account( $p_username, $p_email ) { $t_message = lang_get( 'new_account_signup_msg' ) . "\n\n" . lang_get( 'new_account_username' ) . ' ' . $p_username . "\n" . lang_get( 'new_account_email' ) . ' ' . $p_email . "\n" . lang_get( 'new_account_IP' ) . ' ' . $_SERVER["REMOTE_ADDR"] . "\n" . $g_path . "\n\n" . lang_get( 'new_account_do_not_reply' ); if( !is_blank( $t_recipient_email ) ) { - email_store( $t_recipient_email, $t_subject, $t_message ); + email_store( 'email_notification_new_account', $t_recipient_email, $t_subject, $t_message ); log_event( LOG_EMAIL, sprintf( 'New Account Notify for email = \'%s\'', $t_recipient_email ) ); if( OFF == config_get( 'email_send_using_cronjob' ) ) { @@ -781,7 +783,7 @@ function email_bug_deleted( $p_bug_id ) { * @param array $p_headers * @return int */ -function email_store( $p_recipient, $p_subject, $p_message, $p_headers = null ) { +function email_store( $p_message_id, $p_recipient, $p_subject, $p_message, $p_headers = null, $p_params = null ) { $t_recipient = trim( $p_recipient ); $t_subject = string_email( trim( $p_subject ) ); $t_message = string_email_links( trim( $p_message ) ); @@ -817,6 +819,8 @@ function email_store( $p_recipient, $p_subject, $p_message, $p_headers = null ) } $t_email_data->metadata['hostname'] = $t_hostname; + $t_email_data = event_signal( 'EVENT_NOTIFY_EMAIL', $t_email_data, array( 'message_id' => $p_message_id, 'params' => $p_params ) ); + $t_email_id = email_queue_add( $t_email_data ); return $t_email_id; @@ -930,7 +934,7 @@ function email_send( $p_email_data ) { break; } - $mail->IsHTML( false ); # set email format to plain text + $mail->IsHTML( isset( $t_email_data->metadata['Content-Type'] ) && stripos( $t_email_data->metadata['Content-Type'], "text/html" ) !== false ); $mail->WordWrap = 80; # set word wrap to 50 characters $mail->Priority = $t_email_data->metadata['priority']; # Urgent = 1, Not Urgent = 5, Disable = 0 $mail->CharSet = $t_email_data->metadata['charset']; @@ -1126,8 +1130,10 @@ function email_bug_reminder( $p_recipients, $p_bug_id, $p_message ) { $t_header = "\n" . lang_get( 'on_date' ) . " $t_date, $t_sender $t_sender_email " . lang_get( 'sent_you_this_reminder_about' ) . ": \n\n"; $t_contents = $t_header . string_get_bug_view_url_with_fqdn( $p_bug_id, $t_recipient ) . " \n\n$p_message"; + $t_params = array( 'message' => $p_message, 'bug_id' => $p_bug_id, 'recipient' => $t_recipient, 'sender' => $t_sender, 'sender_email' => $t_sender_email ); + if( ON == config_get( 'enable_email_notification' ) ) { - email_store( $t_email, $t_subject, $t_contents ); + email_store( 'email_bug_reminder', $t_email, $t_subject, $t_contents, null, $t_params ); } lang_pop(); @@ -1189,7 +1195,7 @@ function email_bug_info_to_one_user( $p_visible_bug_data, $p_message_id, $p_proj } # send mail - $t_ok = email_store( $t_user_email, $t_subject, $t_message, $t_mail_headers ); + $t_ok = email_store( $p_message_id, $t_user_email, $t_subject, $t_message, $t_mail_headers, array_merge( $p_visible_bug_data, array( 'header_optional_params' => $p_header_optional_params ) ) ); return $t_ok; } index: core/events_inc.php =================================================================== --- a/core/events_inc.php +++ b/core/events_inc.php @@ -108,6 +108,7 @@ event_declare_many( array( # Email notification events 'EVENT_NOTIFY_USER_INCLUDE' => EVENT_TYPE_DEFAULT, 'EVENT_NOTIFY_USER_EXCLUDE' => EVENT_TYPE_DEFAULT, + 'EVENT_NOTIFY_EMAIL' => EVENT_TYPE_CHAIN, # Wiki events 'EVENT_WIKI_INIT' => EVENT_TYPE_FIRST, index: docbook/developers/en/event-reference-notify.sgml =================================================================== --- a/docbook/developers/en/event-reference-notify.sgml +++ b/docbook/developers/en/event-reference-notify.sgml @@ -55,4 +55,31 @@ </sect2> + <sect2 id="dev.eventref.notify.email"> + <title>Email notification </title> + + <blockquote id="dev.eventref.notify.email"> + <title>EVENT_NOTIFY_EMAIL (Chained)</title> + + <blockquote> + <para> + This event allows a plugin to modify an email notification message before it is sent. + </para> + + <itemizedlist> + <title>Parameters</title> + <listitem><para><Complex>: email message to be sent, EmailData object (see core\email_queue_api.php)</para></listitem> + <listitem><para><String>: message type identificator</para></listitem> + <listitem><para><Array>: message parameters</para></listitem> + + </itemizedlist> + + <itemizedlist> + <title>Return Value</title> + <listitem><para><Complex>: email message to be sent, EmailData object</para></listitem> + </itemizedlist> + </blockquote> + </blockquote> + </sect2> + </sect1> index: manage_user_update.php =================================================================== --- a/manage_user_update.php +++ b/manage_user_update.php @@ -164,7 +164,7 @@ if ( $f_send_email_notification ) { $t_subject = '[' . config_get( 'window_title' ) . '] ' . lang_get( 'email_user_updated_subject' ); $t_updated_msg = lang_get( 'email_user_updated_msg' ); $t_message = $t_updated_msg . "\n\n" . config_get( 'path' ) . 'account_page.php' . "\n\n" . $t_changes; - email_store( $t_email, $t_subject, $t_message ); + email_store( 'email_notification_user_update', $t_email, $t_subject, $t_message, null, array( 'changes' => $t_changes ) ); log_event( LOG_EMAIL, sprintf( 'Account update notification sent to ' . $f_username . ' (' . $t_email . ')' ) ); if ( config_get( 'email_send_using_cronjob' ) == OFF ) { email_send_all(); 02-1.2.7-email_attachments.patch (4,154 bytes)
Index: core/email_api.php =================================================================== --- a/core/email_api.php +++ b/core/email_api.php @@ -992,6 +992,17 @@ } } + if( isset( $t_email_data->metadata['attachments'] ) && is_array( $t_email_data->metadata['attachments'] ) ) { + if( count( $t_email_data->metadata['attachments'] ) > 0 ){ + log_event( LOG_EMAIL, 'Attachments: '.print_r($t_email_data->metadata['attachments'],true ) ); + $t_files = file_get_attachments( $t_email_data->metadata['attachments'] ); + log_event( LOG_EMAIL, 'Read '.count( $t_files ).' file(s) to be attached to the email' ); + foreach( $t_files as $t_index => $t_file ) { + $mail->AddStringAttachment( $t_file['content'], $t_file['display_name'] ); + log_event( LOG_EMAIL, 'Attachment '.$t_file['display_name'].', size = '.$t_file['size'].' added' ); + } + } + } try { if ( !$mail->Send() ) { Index: core/email_queue_api.php =================================================================== --- a/core/email_queue_api.php +++ b/core/email_queue_api.php @@ -34,6 +34,7 @@ var $body = ''; var $metadata = array( 'headers' => array(), + 'attachments' => array(), ); // auto-populated properties Index: core/file_api.php =================================================================== --- a/core/file_api.php +++ b/core/file_api.php @@ -435,6 +435,7 @@ function file_ftp_get( $p_conn_id, $p_local_filename, $p_remote_filename ) { helper_begin_long_process(); $download = ftp_get( $p_conn_id, $p_local_filename, $p_remote_filename, FTP_BINARY ); + return $download; } # Delete a file from the ftp server @@ -455,6 +456,61 @@ } } + +# -------------------- +# Gets an array of attachments whose ids are included in the passed array. +# Content of the files are fetched basing on the 'file_upload_method' config value +# Each element of the result array contains the following: +# id - Id of the file in the database +# bug_id - Id of the bug that the file is attached to +# display_name - The attachment display name (i.e. file name dot extension) +# size - The attachment size in bytes. +# date_added - The date where the attachment was added. +# content - content of the file +# diskfile - The name of the file on disk. Typically this is a hash without an extension. +function file_get_attachments( $p_file_ids ) { + $t_result_array = array(); + $t_ids = is_array( $p_file_ids ) ? $p_file_ids : array( $p_file_ids ); + $t_ids = array_unique( $t_ids ); + $t_bug_file_table = db_get_table( 'mantis_bug_file_table' ); + $query = "SELECT id, bug_id, filename AS display_name, filesize AS size, date_added, content, diskfile + FROM $t_bug_file_table + WHERE id IN (" .implode( ",", $t_ids ).")"; + $result = db_query_bound( $query ); + $t_project_id = -1; + $t_bug_id = -1; + while ( $row = db_fetch_array( $result ) ) { + if( $t_bug_id != $row['bug_id'] ){ + $t_bug_id = $row['bug_id']; + $t_project_id = bug_get_field( $t_bug_id, 'project_id' ); + } + switch ( config_get( 'file_upload_method' ) ) { + case DISK: + $t_local_disk_file = file_normalize_attachment_path( $row['diskfile'], $t_project_id ); + if ( file_exists( $t_local_disk_file ) ) + $row['content'] = file_get_contents( $t_local_disk_file ); + else + $row['content'] = "file [".$row['display_name']."] not found (disk)"; + break; + case FTP: + $t_local_disk_file = file_normalize_attachment_path( $row['diskfile'], $t_project_id ); + if ( !file_exists( $t_local_disk_file ) ) { + $t_ftp = file_ftp_connect(); + $t_downloaded = file_ftp_get( $t_ftp, $t_local_disk_file, $row['diskfile'] ); + file_ftp_disconnect( $ftp ); + if( $downloaded ) + $row['content'] = file_get_contents( $t_local_disk_file ); + else + $row['content'] = "file [".$row['display_name']."] not found (ftp)"; + } else { + $row['content'] = file_get_contents( $t_local_disk_file ); + } + } + $t_result_array[] = $row; + } + return $t_result_array; +} + # Return the specified field value function file_get_field( $p_file_id, $p_field_name, $p_table = 'bug' ) { $c_field_name = db_prepare_string( $p_field_name ); HTMLMail.php (6,560 bytes)
<?php # MantisBT - a php based bugtracking system # MantisBT is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. # # MantisBT is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with MantisBT. If not, see <http://www.gnu.org/licenses/>. /** * This plugin can reformat the mantis e-mails using the templates in the templates directory. * * @package BlackSun Plc. * @copyright Copyright (C) 2010 - 2011 Barnabas Sudy - bsudy@blacksunplc.com */ require_once( config_get( 'class_path' ) . 'MantisPlugin.class.php' ); class HTMLMailPlugin extends MantisPlugin { function register() { $this->name = "HTMLMail"; # Proper name of plugin $this->description = "HTML mail capability"; # Short description of the plugin $this->page = ""; # Default plugin page $this->version = "0.1"; # Plugin version string $this->requires = array( # Plugin dependencies, array of basename => version pairs 'MantisCore' => '1.2', # Should always depend on an appropriate ); $this->author = "Black Sun Plc."; # Author/team name $this->contact = "bsudy@blacksunplc.com"; # Author/team e-mail address $this->url = ""; # Support webpage } function hooks() { return array( 'EVENT_NOTIFY_EMAIL' => 'html_email_formatter', ); } function html_email_formatter( $p_event, $p_email, $p_message_id, $p_params ) { if ( ( $t_template = $this->html_mail_load_template( $p_message_id ) ) !== false) { $t_normal_date_format = config_get( 'normal_date_format' ); $t_complete_date_format = config_get( 'complete_date_format' ); $t_message_title = lang_get_defaulted( $p_message_id, null ); # grab the project name $p_params['email_subject_bug_id_part'] = '[' . $p_params['email_project'] . ' ' . bug_format_id( $p_params['email_bug'] ) . '] '; $p_params['email_status_formatted'] = get_enum_element( 'status', $p_params['email_status'] ); $p_params['email_severity_formatted'] = get_enum_element( 'severity', $p_params['email_severity'] ); $p_params['email_priority_formatted'] = get_enum_element( 'priority', $p_params['email_priority'] ); $p_params['email_reproducibility_formatted'] = get_enum_element( 'reproducibility', $p_params['email_reproducibility'] ); $p_params['email_date_submitted_formatted'] = date( $t_complete_date_format, $p_params['email_date_submitted'] ); $p_params['email_last_modified_formatted'] = date( $t_complete_date_format, $p_params['email_last_modified'] ); $t_params = array_merge( $p_params, array( 'message_title' => $t_message_title , 'message_id' => $p_message_id, ) ); $p_email->body = $this->html_mail_format($t_template, $t_params); $p_email->metadata['Content-Type'] = 'text/html'; log_event( LOG_EMAIL,'Before attaching file_id to EmailData'); if( is_array( $p_params ) && is_array( $p_params['history'] ) ) { log_event( LOG_EMAIL,'Bug history defined' ); bug_ensure_exists($p_params['email_bug']); $t_reporter_id = bug_get_field( $p_params['email_bug'], 'reporter_id' ); $t_deleted = array(); $t_added = array(); //$t_assigned = config_get( 'bug_resolved_status_threshold' ); log_event( LOG_EMAIL,'Bug ['.$p_params['email_bug'].'] exists, selecting files to attach' ); $t_was_more_than_assigned = false; for( $i = count( $p_params['history'] ) - 1; $i>=0; $i-- ){ if( $p_params['history'][$i]['type'] == NORMAL_TYPE && $p_params['history'][$i]['field'] == 'status' && $p_params['history'][$i]['new_value'] > ASSIGNED ) { if( $t_was_more_than_assigned ) break; $t_was_more_than_assigned = true; continue; } if( $p_params['history'][$i]['type'] == FILE_DELETED ){ $t_deleted[] = $p_params['history'][$i]['old_value']; continue; } if( $p_params['history'][$i]['type'] == FILE_ADDED && $p_params['history'][$i]['userid'] != $t_reporter_id ){ if( in_array( $p_params['history'][$i]['old_value'], $t_deleted ) ){ unset( $t_deleted[array_search( $p_params['history'][$i]['old_value'], $t_deleted )] ); } else { $t_added[] = $p_params['history'][$i]['old_value']; } } } if( count( $t_added ) > 0 ){ $t_files = bug_get_attachments( $p_params['email_bug'] ); foreach( $t_files as $file ){ if( in_array( $file['filename'], $t_added ) ){ $p_email->metadata['attachments'][] = $file['id']; } } } } else { log_event( LOG_EMAIL,'Bug history not defined - no attachments added' ); } log_event( LOG_EMAIL,'After attach_files_to_emaildata called' ); log_event( LOG_EMAIL,'HTML email body:\n '.$p_email->body ); log_event( LOG_EMAIL,'\n$params available for email template:\n '.print_r( $p_params ,true) ); } return $p_email; } function html_mail_load_template($p_message_id) { $t_filename = config_get_global( 'plugin_path' ) . plugin_get_current() . '\\templates\\' . $p_message_id . ".tpl"; if ( is_file( $t_filename ) && is_readable( $t_filename ) ) { $t_file = fopen( $t_filename, "r" ); $t_content = fread( $t_file, filesize( $t_filename ) ); fclose( $t_file ); return $t_content; } else { return false; } } function array_to_table($array) { $paramtable = "<table>\n"; foreach ($array as $key => $value) { $paramtable .= "<tr><td>$key</td><td>"; if (is_array($value)) { $paramtable .= array_to_table($value); } else { $paramtable .= $value; } $paramtable .= "</td></tr>\n"; } $paramtable .= "</table>\n"; return $paramtable; } function html_mail_format($t_template, $parameters) { ob_start(); $t_evalresult = eval("?>" . $t_template . "<?php "); $t_result = ob_get_contents(); ob_end_clean(); if ( $t_evalresult === false && ( $t_error = error_get_last() ) ) { return $t_template; } else { return $t_result; } } } | ||||
related to | 0013692 | new | Extending e-mail notifications with a short summary of changed properties | |
related to | 0001400 | assigned | vboctor | Feature to send HTML-formatted e-mail instead of text e-mail |
has duplicate | 0014510 | closed | atrol | Allowing Plugins to handle email sending |
has duplicate | 0020586 | closed | atrol | support html templates in email reporting |
has duplicate | 0025670 | closed | dregad | Is there a way to enable HTML emails (PHPMailer) without changing the value $mail->isHTML( false ); in the core? |
has duplicate | 0033357 | closed | atrol | Custom HTML message email format |
related to | 0009602 | assigned | vboctor | Email Notification with Attachment |
related to | 0010084 | acknowledged | Integration with jabber? | |
related to | 0012639 | new | Fields in email always display, despite the fact that they are not displayed anywhere in pages | |
related to | 0008986 | new | customized eMail subjects | |
related to | 0014006 | closed | atrol | Impossibility to configure which fields are displayed in the email of notification |
related to | 0024038 | closed | atrol | Besoin Plugin HTMLMail V2.0 |
related to | 0035247 | confirmed | Data too long for column 'body' when adding a note to an Issue |
Thanks - working great here! Just a small note: To use this on a Linux-based server I had to replace the windows-specific '\' in the function HTMLMailPlugin::html_mail_load_template(): $t_filename = config_get_global( 'plugin_path' ) . plugin_get_current() . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . $p_message_id . ".tpl"; |
|
@barnabas.sudy, thanks a lot! Since the old HTMLMail-0.0.7.pkg is no more compatible with Mantis 1.2.*, this "new" plugin is the only solution until Mantis 1.3 is not released. I modified the patch included in the zip so the plugin can be now installed on 1.2.5. I installed it and as far as I see, it works! If there is interest in development of this plugin and the templates, we can start a repo? Do you know the development status of email templates in 1.3? |
|
I can confirm that the patch I provided (mantis-1.2.5-patch-for-htmlmail-0.1.patch) and the plugin seem to be compatible with mantisbt 1.2.6 |
|
Currently I am working on adding to this plugin attachments. In my installation it email attachments work, but they needed some changes in the Mantis core. I will work on introducing this changes to the next (1.2.7 ?) stable release. |
|
currently this plugin works with 1.2.4-7 (I will upload patch for Mantis 1.2.7 soon) Once I have some more time (read: I finally integrate FileMaker with Mantis), I will try to contribute to 1.3 |
|
So, I've just uploaded the patches for 1.2.7 and modified plugin file that can send attachments. |
|
Anxiously waiting for your patch... :) |
|
Unfortunately, I had not had time so far to upgrade my local system, but I have checked today the my patches for 1.2.7 against 1.2.8 and they are at least syntactically compatible with the last, 1.2.8 release of Mantis so they can be applied without modifications. |
|
And just one note about attachments. |
|
Just installed on the latest Mantis (1.2.8) and HTML Mail works fine (Thanks for the patch). In templates/template_body.tpl, had to change lines : Line 55 Same on line 115, change $t_bugnote->note This makes PHP convert every new line to a br /> and avoid having a huge block of text. anybody got a tuto on how to set up the mail attachments ? still can't get it working properly. |
|
I would like to use this plugin with 1.2.12. Has anybody done this already? |
|
I would like to use this plugin with 1.2.12. Has anybody done this already? |
|
i am new to mantis can any one help me how to install this plugin ( i have unzip and putted this plugin in my mantis plugin folder ) but after installing from admin >> manger >> Manage Plugins i am getting warring message " APPLICATION WARNING #2400: Event "EVENT_NOTIFY_EMAIL" has not yet been declared. " .... also please help me how to install PATCH ..etc |
|
any one pls help me |
|
You need to apply the patch which you can find inside the zipfile. |
|
In download folder there is mantis-1.2.4-patch-for-htmlmail-0.1 but in that on first line there is path for --- core/email_api.php Thu Jan 15 09:14:12 1970 and 2 more path which i cant found in the HTMLMail0.1zip folder .. hence its means i have to replace that patch code in my orignal mantis core folder file ??.. please help me Thanks |
|
that is correct, that are changes on core scripts |
|
Hi, And it woks on a 1.2.12 . I have done to much modification on my mantis to provide a whole patch sorry ! |
|
Please help anyone. I'm trying to apply the patch for MantisBT 1.2.11 on Debian: #patch -p0 -i 01-1.2.7-patch-to-use-HTMLMail-0.1.patch but get the following: (Stripping trailing CRs from patch.) What am I doing wrong? |
|
Chewits the pathfile 01-1.2.7-patch-to-use-HTMLMail-0.1.patch works with MantisBT 1.2.7 for MantisBT 1.2.11 you have to apply the changes manually :-( |
|
Hello, I have install this plugin and it works but i don't have the link to configure in the plugin manager. Do you know why ? My Mantis is 1.2.14 |
|
Hello, There is a 'bug' in HTMLMail.php (line:121), '\templates\' must be replaced by '/templates/' if the server is a linux. |
|
I was able to make it work fine with 1.2.17. Naturally, I had to manually apply all the patches. It was pretty much the same, except for a line in email_api.php that was slightly different in 1.2.17, in which email_store is actually assigned to a variable, but it is easy to spot. As far as manager configuration page, I don't think there is one at all (I could be wrong). Everything works, except one thing. I have a custom status enum string as follows: $g_status_enum_string = "10:new,20:feedback,30:acknowledged,40:confirmed,50:assigned,60:active,70:on hold,80:resolved,90:closed"; The email notification event gets triggered by all of the status changes but the 2 extra I added: 60:active, and 70:on hold. Mantis does send an email, but it is the old, plain text one. Any help on how to get mantis to trigger the same event that ends up calling the HTMLMail plugin? Once I get that set up, this plugin will work 100% on my environment. |
|
Just a followup (I hate when people ask questions, then solve it themselves and never come back to write their solution). I was able to solve my problem by creating the correct template files for my 2 custom statuses, in this case: email_notification_title_for_status_bug_active.tpl Thanks for this plugin! Adds such power to my old, clanky bug tracking system. |
|
Hello! Plugin was installed, patch was applied, but notification continue receive in plain text format. Mantis ver. 1.2.15 Anybody know, what to do yet that notification receive in html format? |
|
Sorry, resolve problem. in HTMLMail.php (line:121), '\templates\' must be replaced by '/templates/' if the server is a linux. |
|
I have one question! Anybody know how I can make language strings?! |
|
It's standard: |
|
Thank you for explain. Unfortunately, it did not work. I trying to add one string from your example and get error. http://mantis/admin/test_langs.php Trying to find+check plugin language files... Checking language files for plugin HTMLMail: |
|
Perhaps it makes sense to release a plug-in version 0.2? :) Adding the language support and a color stain status as well as the system itself. |
|
yeah, but I thing the error messages are quite clear: |
|
My version is mantisbt-1.2.10, I applied the patch one by one and it work, the notification email come with jpg/png attachment. But recently the email was sent out without attachment, I tried another smtp server, it's still no attachment with email, I turn the debug on but can not find out what's the problem. 2015-07-09 16:13 CST mail Issue = #123, Type = new, Msg = 'email_notification_title_for_action_bug_submitted', User = @U8, Email = 'knowledge@chn.mycompany.com'.
</table> <h2>Summary:</h2>
) 2015-07-09 16:13 CST mail Issue = #123, Type = new, Msg = 'email_notification_title_for_action_bug_submitted', User = @U2, Email = 'david.li@dc01.mycompany'.
</table> <h2>Summary:</h2>
) 2015-07-09 16:13 CST mail Issue = #123, Type = new, Msg = 'email_notification_title_for_action_bug_submitted', User = @U6, Email = 'Jacky.Lu@chn.mycompany.com'.
</table> <h2>Summary:</h2>
) 2015-07-09 16:13 CST mail Issue = #123, Type = new, Msg = 'email_notification_title_for_action_bug_submitted', User = @U9, Email = 'rayna.wei@chn.mycompany.com'.
</table> <h2>Summary:</h2>
) |
|
Please write about this plugin somewhere on main site. |
|
update for 1.3.0 rc1 |
|
update for 1.3.0 rc1 with overwrite files. |
|
i mean for 1.3.0-rc.2-dev master-9d8d010 |
|
It's no good idea to tell users to install a 3rd party plugin which is not maintained. |
|
what is good or not? as for me : bulk text is not good, nice html is good. i check this plugin and it works good for mantis 1.3.0 rc2. |
|
Please tell me how to make attachments were sent only when it is added, but not in all further email? |
|
hi, AlexeiK I upgrade my installation from 1.2.8 to 1.3.1 the implemented with HTMLMail_1.3.0.rc1_plus_overwrite.rar, the email notification work but the attachment (jpg) did not attached with the email. I also tried implemented it on a new installation of 1.3.0rc1, still no attachment with email. want to try 1.3.0rc2 but can not find where to download it. |
|
I applied this to 1.3.0 rc2. The emails do come out as HTML, nicely formatted. The only thing not working is the manage_user_update.php. The minute I add the line with email_notification_user_update, the system fails. AlexeiK- how did you get to work? Did I miss a step? |
|
akimeu007, i will move to mantis 2 and check how it goes there. |
|
Hello, AlexeiK You managed to adapt it to new versions 2.x? |
|
DjBend, i didnt move to mantis 2.0. |
|
Hi, AlexeiK |
|
Hello, @AlexeiK, @gdicesare, @or_anyone :) Thank you for any help. Regards. |
|
Hi @mjaq Regards. |
|
Hi, @gdicesare, @AlexeiK, Regards. |
|
i cant let myself use mantis 2.0 - why? it has ugly interface and not usable for me anymore. so im not interested . |
|
@ users who want to use this plugin, read 0012830:0052501 before installation. |
|
I'm basically in agreement with you. Best regards. |
|
@atrol |
|
https://mantisbt.org/docs/master/en-US/Developers_Guide/html-desktop/#dev.contrib.submit |
|
@atrol @contributor I'm not familiar with: Sorry for my english (DIY with google). I'm French with only the necessary bases to evolve in the computing developments. |
|
Hi @gdicesare, You kinda solve the issue by commenting core lines in email_api. Do you remeber wich lines it was? Thanks |
|
Tanks to DjBend (https://www.mantisbt.org/bugs/view.php?id=12830#c55526)[...]In HTMLMail.php file replacement conditions htmlmail-mantisbt-2.6.patch (5,737 bytes)
--- old/core/email_api.php 2018-04-16 13:01:22.100461100 +0200 +++ new/core/email_api.php 2018-04-16 14:23:17.076137200 +0200 @@ -523,7 +523,9 @@ function email_signup( $p_user_id, $p_co # Send signup email regardless of mail notification pref # or else users won't be able to sign up if( !is_blank( $t_email ) ) { - email_store( $t_email, $t_subject, $t_message, null, true ); + $t_params = array('admin_name' => $p_admin_name, 'user_id' => $p_user_id, 'confirm_hash' => $p_confirm_hash); + email_store( $t_email, $t_subject, $t_message, 'email_notification_signup', $t_params, null, true ); + log_event( LOG_EMAIL, 'Signup Email = %s, Hash = %s, User = @U%d', $t_email, $p_confirm_hash, $p_user_id ); } @@ -562,7 +564,8 @@ function email_send_confirm_hash_url( $p # Send password reset regardless of mail notification preferences # or else users won't be able to receive their reset passwords if( !is_blank( $t_email ) ) { - email_store( $t_email, $t_subject, $t_message, null, true ); + $t_params = array('user_id' => $p_user_id, 'confirm_hash' => $p_confirm_hash); + email_store( $t_email, $t_subject, $t_message, 'email_notification_forgotten_password', $t_params, null, true ); log_event( LOG_EMAIL, 'Password reset for user @U%d sent to %s', $p_user_id, $t_email ); } else { log_event( LOG_EMAIL, 'Password reset for user @U%d not sent, email is empty', $p_user_id ); @@ -595,7 +598,8 @@ function email_notify_new_account( $p_us $t_message = lang_get( 'new_account_signup_msg' ) . "\n\n" . lang_get( 'new_account_username' ) . ' ' . $p_username . "\n" . lang_get( 'new_account_email' ) . ' ' . $p_email . "\n" . lang_get( 'new_account_IP' ) . ' ' . $_SERVER['REMOTE_ADDR'] . "\n" . config_get_global( 'path' ) . "\n\n" . lang_get( 'new_account_do_not_reply' ); if( !is_blank( $t_recipient_email ) ) { - email_store( $t_recipient_email, $t_subject, $t_message ); + + email_store( $t_email, $t_subject, $t_message, 'email_notification_new_account' ); log_event( LOG_EMAIL, 'New Account Notify for email = \'%s\'', $t_recipient_email ); } @@ -1134,7 +1138,8 @@ function email_bug_deleted( $p_bug_id ) * even when using cronjob * @return integer|null */ -function email_store( $p_recipient, $p_subject, $p_message, array $p_headers = null, $p_force = false ) { +function email_store( $p_recipient, $p_subject, $p_message, $p_message_id = null, $p_params = null, array $p_headers = null, $p_force = false ) { + global $g_email_shutdown_processing; $t_recipient = trim( $p_recipient ); @@ -1169,6 +1174,8 @@ function email_store( $p_recipient, $p_s } $t_email_data->metadata['hostname'] = $t_hostname; + $t_email_data = event_signal('EVENT_NOTIFY_EMAIL', $t_email_data, array( 'message_id' => $p_message_id, 'params' => $p_params,)); + $t_email_id = email_queue_add( $t_email_data ); # Set the email processing flag for the shutdown function @@ -1300,7 +1307,7 @@ function email_send( EmailData $p_email_ break; } - $t_mail->IsHTML( false ); # set email format to plain text + $t_mail->IsHTML( isset( $t_email_data->metadata['Content-Type'] ) && stripos( $t_email_data->metadata['Content-Type'], "text/html" ) !== false ); $t_mail->WordWrap = 80; # set word wrap to 80 characters $t_mail->CharSet = $t_email_data->metadata['charset']; $t_mail->Host = config_get( 'smtp_host' ); @@ -1482,7 +1489,8 @@ function email_bug_reminder( $p_recipien $t_header = "\n" . lang_get( 'on_date' ) . ' ' . $t_date . ', ' . $t_sender . ' ' . $t_sender_email . lang_get( 'sent_you_this_reminder_about' ) . ': ' . "\n\n"; $t_contents = $t_header . string_get_bug_view_url_with_fqdn( $p_bug_id ) . " \n\n" . $p_message; - $t_id = email_store( $t_email, $t_subject, $t_contents ); + $t_params = array( 'message' => $p_message, 'bug_id' => $p_bug_id, 'recipient' => $t_recipient, 'sender' => $t_sender, 'sender_email' => $t_sender_email ); + $t_id = email_store( $t_email, $t_subject, $t_contents,'email_bug_reminder', $t_params ); if( $t_id !== null ) { $t_result[] = $t_recipient; } @@ -1615,9 +1623,8 @@ function email_bug_info_to_one_user( arr } else { $t_mail_headers['In-Reply-To'] = $t_message_md5; } - # send mail - email_store( $t_user_email, $t_subject, $t_message, $t_mail_headers ); + email_store( $t_user_email, $t_subject, $t_message, $p_message_id, array_merge($p_visible_bug_data, array('header_optional_params' => $p_header_optional_params)), $t_mail_headers); return; } --- old/core/events_inc.php 2018-04-16 13:01:18.674086000 +0200 +++ new/core/events_inc.php 2018-04-16 14:20:31.752531500 +0200 @@ -138,6 +138,7 @@ event_declare_many( array( # Email notification events 'EVENT_NOTIFY_USER_INCLUDE' => EVENT_TYPE_DEFAULT, 'EVENT_NOTIFY_USER_EXCLUDE' => EVENT_TYPE_DEFAULT, + 'EVENT_NOTIFY_EMAIL' => EVENT_TYPE_CHAIN, # Wiki events 'EVENT_WIKI_INIT' => EVENT_TYPE_FIRST, --- old/manage_user_update.php 2018-04-16 13:01:09.928648900 +0200 +++ new/manage_user_update.php 2018-04-16 14:16:15.655752900 +0200 @@ -205,7 +205,7 @@ if( $f_send_email_notification ) { $t_updated_msg = lang_get( 'email_user_updated_msg' ); $t_message = $t_updated_msg . "\n\n" . config_get( 'path' ) . 'account_page.php' . "\n\n" . $t_changes; - if( null === email_store( $t_email, $t_subject, $t_message ) ) { + if( null === email_store( $f_email, $t_subject, $t_message, 'email_notification_user_update', array( 'changes' => $t_changes ) ) ) { log_event( LOG_EMAIL, 'Notification was NOT sent to ' . $f_username ); } else { log_event( LOG_EMAIL, 'Account update notification sent to ' . $f_username . ' (' . $t_email . ')' ); |
|
Hi @rkarmann, Cheers |
|
Hello, |
|
Hello, htmlmail-mantisbt-2.15.patch (5,592 bytes)
--- old/core/email_api.php 2018-07-16 23:58:00.598800300 +0200 +++ new/core/email_api.php 2018-07-16 23:56:47.670800300 +0200 @@ -530,7 +530,8 @@ # Send signup email regardless of mail notification pref # or else users won't be able to sign up if( !is_blank( $t_email ) ) { - email_store( $t_email, $t_subject, $t_message, null, true ); + $t_params = array('admin_name' => $p_admin_name, 'user_id' => $p_user_id, 'confirm_hash' => $p_confirm_hash); + email_store( $t_email, $t_subject, $t_message, 'email_notification_signup', $t_params, null, true ); log_event( LOG_EMAIL, 'Signup Email = %s, Hash = %s, User = @U%d', $t_email, $p_confirm_hash, $p_user_id ); } @@ -569,7 +570,8 @@ # Send password reset regardless of mail notification preferences # or else users won't be able to receive their reset passwords if( !is_blank( $t_email ) ) { - email_store( $t_email, $t_subject, $t_message, null, true ); + $t_params = array('user_id' => $p_user_id, 'confirm_hash' => $p_confirm_hash); + email_store( $t_email, $t_subject, $t_message, 'email_notification_forgotten_password', $t_params, null, true ); log_event( LOG_EMAIL, 'Password reset for user @U%d sent to %s', $p_user_id, $t_email ); } else { log_event( LOG_EMAIL, 'Password reset for user @U%d not sent, email is empty', $p_user_id ); @@ -602,7 +604,7 @@ $t_message = lang_get( 'new_account_signup_msg' ) . "\n\n" . lang_get( 'new_account_username' ) . ' ' . $p_username . "\n" . lang_get( 'new_account_email' ) . ' ' . $p_email . "\n" . lang_get( 'new_account_IP' ) . ' ' . $_SERVER['REMOTE_ADDR'] . "\n" . config_get_global( 'path' ) . "\n\n" . lang_get( 'new_account_do_not_reply' ); if( !is_blank( $t_recipient_email ) ) { - email_store( $t_recipient_email, $t_subject, $t_message ); + email_store( $t_email, $t_subject, $t_message, 'email_notification_new_account' ); log_event( LOG_EMAIL, 'New Account Notify for email = \'%s\'', $t_recipient_email ); } @@ -1141,7 +1143,7 @@ * even when using cronjob * @return integer|null */ -function email_store( $p_recipient, $p_subject, $p_message, array $p_headers = null, $p_force = false ) { +function email_store( $p_recipient, $p_subject, $p_message, $p_message_id = null, $p_params = null, array $p_headers = null, $p_force = false ) { global $g_email_shutdown_processing; $t_recipient = trim( $p_recipient ); @@ -1176,6 +1178,8 @@ } $t_email_data->metadata['hostname'] = $t_hostname; + $t_email_data = event_signal('EVENT_NOTIFY_EMAIL', $t_email_data, array( 'message_id' => $p_message_id, 'params' => $p_params,)); + $t_email_id = email_queue_add( $t_email_data ); # Set the email processing flag for the shutdown function @@ -1322,7 +1326,7 @@ $t_mail->DKIM_identity = config_get( 'email_dkim_identity' ); } - $t_mail->IsHTML( false ); # set email format to plain text + $t_mail->IsHTML( isset( $t_email_data->metadata['Content-Type'] ) && stripos( $t_email_data->metadata['Content-Type'], "text/html" ) !== false ); $t_mail->WordWrap = 80; # set word wrap to 80 characters $t_mail->CharSet = $t_email_data->metadata['charset']; $t_mail->Host = config_get( 'smtp_host' ); @@ -1504,7 +1508,8 @@ $t_header = "\n" . lang_get( 'on_date' ) . ' ' . $t_date . ', ' . $t_sender . ' ' . $t_sender_email . lang_get( 'sent_you_this_reminder_about' ) . ': ' . "\n\n"; $t_contents = $t_header . string_get_bug_view_url_with_fqdn( $p_bug_id ) . " \n\n" . $p_message; - $t_id = email_store( $t_email, $t_subject, $t_contents ); + $t_params = array( 'message' => $p_message, 'bug_id' => $p_bug_id, 'recipient' => $t_recipient, 'sender' => $t_sender, 'sender_email' => $t_sender_email ); + $t_id = email_store( $t_email, $t_subject, $t_contents,'email_bug_reminder', $t_params ); if( $t_id !== null ) { $t_result[] = $t_recipient; } @@ -1639,7 +1644,7 @@ } # send mail - email_store( $t_user_email, $t_subject, $t_message, $t_mail_headers ); + email_store( $t_user_email, $t_subject, $t_message, $p_message_id, array_merge($p_visible_bug_data, array('header_optional_params' => $p_header_optional_params)), $t_mail_headers); return; } diff -ruN old/core/events_inc.php new/core/events_inc.php --- old/core/events_inc.php 2018-07-16 23:57:54.820800300 +0200 +++ new/core/events_inc.php 2018-07-16 23:56:54.965800300 +0200 @@ -139,7 +139,8 @@ # Email notification events 'EVENT_NOTIFY_USER_INCLUDE' => EVENT_TYPE_DEFAULT, 'EVENT_NOTIFY_USER_EXCLUDE' => EVENT_TYPE_DEFAULT, - + 'EVENT_NOTIFY_EMAIL' => EVENT_TYPE_CHAIN, + # Wiki events 'EVENT_WIKI_INIT' => EVENT_TYPE_FIRST, 'EVENT_WIKI_LINK_BUG' => EVENT_TYPE_FIRST, diff -ruN old/manage_user_update.php new/manage_user_update.php --- old/manage_user_update.php 2018-07-16 23:53:57.906800300 +0200 +++ new/manage_user_update.php 2018-07-16 23:55:26.088800300 +0200 @@ -205,7 +205,7 @@ $t_updated_msg = lang_get( 'email_user_updated_msg' ); $t_message = $t_updated_msg . "\n\n" . config_get_global( 'path' ) . 'account_page.php' . "\n\n" . $t_changes; - if( null === email_store( $t_email, $t_subject, $t_message ) ) { + if( null === email_store( $f_email, $t_subject, $t_message, 'email_notification_user_update', array( 'changes' => $t_changes ) ) ) { log_event( LOG_EMAIL, 'Notification was NOT sent to ' . $f_username ); } else { log_event( LOG_EMAIL, 'Account update notification sent to ' . $f_username . ' (' . $t_email . ')' ); |
|
Hello |
|
Hi is anyone able to provide a patch to get bugnote emails working on 2.18.0? I have attempted to modify the code but I can't seem to get them to work correctly, all the other emails i need work perfectly. Looking for some help here please :) |
|
Hi is anyone able to provide a patch to get bugnote emails working on 2.18.0? I have attempted to modify the code but I can't seem to get them to work correctly, all the other emails i need work perfectly. Looking for some help here please :) |
|
Hi is anyone able to provide a patch to get bugnote emails working on 2.18.0? sorry for the spam not sure what happened there??? - please delete the last two comments! |
|
Hello, here is a patch for Mantis 2.18. Have a nice day :) |
|
Hi, Nibie 'Argument 1 passed to email_queue_add() must be an instance of EmailData, null given, called in D:\wamp64\www\mantisbt\core\email_api.php on line 1183 and defined' in 'D:\wamp64\www\mantisbt\core\email_queue_api.php' line 92 Please help. my mantisbt ver is 2.18.0 @Nebie Herrmann |
|
Hi, NOTE: All the files patch were added to the project as well as the plugin files to the folder plugins. Anyone could know what it's the reason?, thanks |
|
This might happen because the plugin requires an event named EVENT_NOTIFY_EMAIL which is not declared in MantisBT core files or no longer used in 2.18... Unfortunately this plugin is no longer maintained by the author, but patched by the community |
|
did someone fixed the plugin? i've got the same issue as here : https://mantisbt.org/bugs/view.php?id=12830#c61516 SYSTEM ERROR 'Argument 1 passed to email_queue_add() must be an instance of EmailData, null given, called in D:\wamp64\www\mantisbt\core\email_api.php on line 1183 and defined' in 'D:\wamp64\www\mantisbt\core\email_queue_api.php' line 92 |
|
omg |
|
Hello. Is there any chance for a plugin for the latest MANTIS version 2.x? |
|
Would also like to know if this will be updated for 2x |
|
I had a look @ this plugin and it depends on a huge number of changes in email_api.php which are not documented anywhere ( at least I could not find it). |
|
In order to address this in vanilla Mantisbt , i have created a PR: https://github.com/mantisbt/mantisbt/pull/1977 |
|
I have prepared PR2079 for adding this functionality( https://github.com/mantisbt-plugins/mailtemplate ) in vanilla Mantis. |
|
nice to see) errors in application on this forum #1406: Data too long for column 'body' at row 1, запрос: INSERT INTO mantis_email_table |
|
@AlexeiK I deleted your extra posts, which looked like duplicates and kept only the most recent one. Not sure if they were multiple submits or attempts to add more info to your original note, in which case please note that there is an Edit button ;-) |
|
Actually, I just realised that this issue is too big, and triggers a database error as MantisBT tries to insert a notification in the email table after a bugnote is added: Data too long for column 'body' Follow-up in 0035247 |
|
Please report issues/remarks/suggestions to Github ( https://github.com/mantisbt-plugins/mailtemplate ) |
|
@cas concerning
There is already |
|
Thanks @Atrol, used that setting |
|
Indeed, depending on how we look at it, it's either something to improve in MantisBT code so it does not trigger an error, and/or fix the mantisbt.org bugtracker's database schema - in any case not related to the original HTMLmail or your mailtemplate plugin. |
|