View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003398 | mantisbt | public | 2003-10-31 23:18 | 2014-11-07 15:06 | |
Reporter | johnwebbcole | Assigned To | |||
Priority | normal | Severity | feature | Reproducibility | always |
Status | new | Resolution | open | ||
Summary | 0003398: Include options for what is sent in an email | ||||
Description | It would be nice to be able to have a few options on what is included in emails. For example: | ||||
Tags | patch | ||||
Attached Files | configurable_email.patch (3,315 bytes)
Index: config_defaults_inc.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/config_defaults_inc.php,v retrieving revision 1.130 diff -u -r1.130 config_defaults_inc.php --- config_defaults_inc.php 1 Sep 2003 14:06:57 -0000 1.130 +++ config_defaults_inc.php 19 Nov 2003 22:10:17 -0000 @@ -186,6 +186,21 @@ # Whether user's should receive emails for their own actions $g_email_receive_own = OFF; + # Include bug history in bug info email + $g_email_include_history = ON; + + # Leave blank for default + # use DESC for decending order by timestamp + $g_email_bugnote_order = ''; + + # limit the number of bugnotes in an email + # note: this only makes sense if the + # email_bugnote_order is 'DESC' + # otherwise only the first few bugnotes + # will be shown instead of the last few + # 0 will return all bugnotes + $g_email_bugnote_limit = 0; + # set to OFF to disable email check $g_validate_email = ON; $g_check_mx_record = ON; Index: core/email_api.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/core/email_api.php,v retrieving revision 1.63 diff -u -r1.63 email_api.php --- core/email_api.php 31 Aug 2003 11:32:20 -0000 1.63 +++ core/email_api.php 19 Nov 2003 22:10:18 -0000 @@ -473,7 +473,8 @@ function email_build_bugnote_message( $p_bug_id ) { global $g_mantis_bugnote_table, $g_mantis_bugnote_text_table, $g_complete_date_format, - $g_bugnote_order, $g_email_separator2; + $g_email_bugnote_order, $g_email_separator2, + $g_email_bugnote_limit; $c_bug_id = (integer)$p_bug_id; @@ -484,7 +485,12 @@ $query = "SELECT *, UNIX_TIMESTAMP(last_modified) as last_modified FROM $g_mantis_bugnote_table WHERE bug_id='$c_bug_id' AND view_state='$t_state' - ORDER BY date_submitted $g_bugnote_order"; + ORDER BY date_submitted $g_email_bugnote_order"; + + if ( $g_email_bugnote_limit > 0 ) { + $query .= " LIMIT 0, $g_email_bugnote_limit"; + } + $result = db_query( $query ); $bugnote_count = db_num_rows( $result ); @@ -543,7 +549,9 @@ $t_message = $p_message."\n"; $t_message .= email_build_bug_message( $p_bug_id, $p_message, $t_category ); $t_message .= email_build_bugnote_message( $p_bug_id ); - $t_message .= email_build_history_message( $p_bug_id ); + if ( ON == config_get( 'email_include_history' ) ) { + $t_message .= email_build_history_message( $p_bug_id ); + } # send mail @@ -603,7 +611,8 @@ # Support PHPMailer v1.7x if ( method_exists( $mail, 'SetLanguage' ) ) { - $mail->SetLanguage( lang_get( 'phpmailer_language' ), $t_phpMailer_path . 'language' . DIRECTORY_SEPARATOR ); + # JwC - this doesn't seem to work with 1.7x + # $mail->SetLanguage( lang_get( 'phpmailer_language' ), $t_phpMailer_path . 'language' . DIRECTORY_SEPARATOR ); } # Select the method to send mail | ||||
I've added a patch from the current CVS version to add a few global parameters for controling email format. g_email_include_history to turn on/off the history at the bottom of an email (if you want it off in the main view, its nice not to see it in the email as well). g_email_bugnote_order just to separate the order in the email from the order in the main view bug g_email_bugnote_limit to limit the number of bugnotes included in the email. This really only makes sense if your g_email_bugnote_order is 'DESC' and you only want to see the last 5 bugnotes. |
|
One other thing in the patch file that some may not want is the phpmailer 1.7x fix that doesn not seem to work on my win32 phpmailer 1.71 version. I commented out a line and that seems to fix it. Milage my vary for others. |
|
Thanks @johnwebbcole for your contribution. Here are a couple of comments:
|
|