Skip to content

Commit

Permalink
- Added support for custom fields in e-mail notifications.
Browse files Browse the repository at this point in the history
git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@1648 f5dc347c-c33d-0410-90a0-b07cc1902cb9
  • Loading branch information
vboctor committed Dec 6, 2002
1 parent f2e0615 commit 10aca0b
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion core/email_api.php
Expand Up @@ -6,7 +6,7 @@
# See the files README and LICENSE for details

# --------------------------------------------------------
# $Id: email_api.php,v 1.26 2002-11-27 02:45:20 jfitzell Exp $
# $Id: email_api.php,v 1.27 2002-12-06 15:01:00 vboctor Exp $
# --------------------------------------------------------

###########################################################################
Expand Down Expand Up @@ -419,6 +419,25 @@ function email_build_bug_message( $p_bug_id, $p_message, &$p_category ) {
$t_message .= str_pad( lang_get( 'email_severity' ) . ': ', ' ', $g_email_padding_length, STR_PAD_RIGHT ).$t_sev_str."\n";
$t_message .= str_pad( lang_get( 'email_priority' ) . ': ', ' ', $g_email_padding_length, STR_PAD_RIGHT ).$t_pri_str."\n";
$t_message .= str_pad( lang_get( 'email_status' ) . ': ', ' ', $g_email_padding_length, STR_PAD_RIGHT ).$t_sta_str."\n";

# @@@ Add support for access levels, possible only send the ones that are available for access level EVERYBODY
if ( ON == config_get( 'use_experimental_custom_fields' ) ) {
$t_related_custom_field_ids = custom_field_get_ids( $v_project_id );
foreach( $t_related_custom_field_ids as $t_id ) {
$t_def = custom_field_get_definition( $t_id );

$t_message .= str_pad( $t_def['name'] . ': ', ' ', $g_email_padding_length, STR_PAD_RIGHT );

$t_custom_field_value = custom_field_get_value( $t_id, $p_bug_id );
if( CUSTOM_FIELD_TYPE_EMAIL == $t_def['type'] ) {
$t_message .= "mailto:$t_custom_field_value";
} else {
$t_message .= $t_custom_field_value;
}
$t_message .= "\n";
} // foreach
}

if ( RESOLVED == $v_status ) {
$t_res_str = get_enum_element( 'resolution', $v_resolution );
$t_message .= str_pad( lang_get( 'email_resolution' ) . ': ', ' ', $g_email_padding_length, STR_PAD_RIGHT ).$t_res_str."\n";
Expand Down

0 comments on commit 10aca0b

Please sign in to comment.