/* addition to config_inc.php $g_email_file_action = ON; /* Addition to email_api.php /** * Send notices that a user has added a file. * @param int $p_bug_id * @param int $p_user_id * @return null */ function email_file_added( $p_bug_id, $p_user_id,$p_file_name ) { $t_opt = array(); $t_opt[] = bug_format_id( $p_bug_id ); $t_opt[] = user_get_name( $p_user_id ); email_generic( $p_bug_id, 'bugnote', 'email_notification_title_for_action_addfile', $t_opt, array( $p_user_id ) ); } /** * Send notices that a user has added a file. * @param int $p_bug_id * @param int $p_user_id * @return null */ function email_file_deleted( $p_bug_id, $p_user_id,$p_file_name ) { $t_opt = array(); $t_opt[] = bug_format_id( $p_bug_id ); $t_opt[] = user_get_name( $p_user_id ); email_generic( $p_bug_id, 'bugnote', 'email_notification_title_for_action_delfile', $t_opt, array( $p_user_id ) ); } / *Addition to the various strings scripts (or minimum to custom_strings_inc.php) $s_email_notification_title_for_action_addfile = 'Issue %1$s, file added by user %2$s.'; $s_email_notification_title_for_action_delfile = 'Issue %1$s, file deleted by user %2$s.'; /* addition fo file_api.php /** * requires email_api */ require_once( 'email_api.php' ); // now find function file_add // and add as last line before the closing bracket // // send email // if( config_get( 'email_file_action' ) == ON ){ email_file_added( $t_bug_id,$c_user_id ); } // Next find function File_delete // and add at the end, just before : Return true; // // send email // if( config_get( 'email_file_action' ) == ON ){ email_file_deleted( $p_bug_id,auth_get_current_user_id() ); }