View Issue Details

IDProjectCategoryView StatusLast Update
0011757mantisbtfeaturepublic2015-06-21 15:01
Reportercas Assigned To 
PrioritynormalSeverityfeatureReproducibilityN/A
Status newResolutionopen 
Summary0011757: request feedback from reporters
Description

We quite often face the problem that people are not responding when we ask their feedback.
So the issue gets status feedback and the reporter gets an email to react.
Most of the time we need to remind them more than once.
In order to increase the peformance, we now send out an email message containing links to those issues for which we are awaiting feedback.
These emails are grouped by reporter, so one email per reporter.

Steps To Reproduce

the whole script:
<?php

This page sends an E-mail to the reporter if an issue is awaiting feedback

require_once( 'core.php' );
$t_core_path = config_get( 'core_path' );
require_once( $t_core_path.'bug_api.php' );
require_once( $t_core_path.'email_api.php' );
$t_subject = 'Issues requiring your attention';
$t_rem_body1 = 'The following issue(s) are awaiting your input';
$t_rem_body2 = 'Please do not reply to this message, use the helpdesk system itself';
$project=24;
$status=20;
$t_bug_table = config_get( 'mantis_bug_table' );
$query = "select id,reporter_id,project_id from $t_bug_table where status=$status and project_id=$project order by reporter_id";
$results = mysql_query( $query );
if ($results){
$start = true ;
$list= "";
// first group and store reminder per issue
while ($row1 = mysql_fetch_array($results, MYSQL_NUM)) {
$tel ++;
$id = $row1[0];
$handler = $row1[1];
$project = $row1[2];
if ($start){
$handler2 = $handler ;
$start = false ;
}
if ($handler== $handler2){
$list .= string_get_bug_view_url_with_fqdn( $id, $handler2 ). " \n\n";
} else {
// now send the grouped email
$body = $t_rem_body1. " \n\n";
$body .= $list. " \n\n";
$body .= $t_rem_body2;
$result = email_group_reminder( $handler2, $body);
$handler2 = $handler ;
$list= string_get_bug_view_url_with_fqdn( $id, $handler2 );
}
}
// handle last grouped email
if ($results){
$body = $t_rem_body1. " \n\n";
$body .= $list. " \n\n";
$body .= $t_rem_body2;
$result = email_group_reminder( $handler2, $body);
}
}

Send Grouped reminder

function email_group_reminder( $p_user_id, $issues ) {
$t_username = user_get_field( $p_user_id, 'username' );
$t_email = user_get_email( $p_user_id );
$t_message = $issues ;
$t_subject = 'Issues requiring your attention';
if( !is_blank( $t_email ) ) {
email_send( $t_email, $t_subject, $t_message );
}
}

Additional Information

Script is ready for 1.0/1.1 series but can easily be adpated for 1.2

We run this daily (windows => Scheduled task, *nix => cron)

TagsNo tags attached.

Relationships

related to 0019866 new Include bug reporter "Send a remind" 

Activities

cas

cas

2010-04-12 06:46

reporter   ~0025098

Updated the code so it delivers proper email:
<?php

This page sends an E-mail to the reporter if an issue is awaiting feedback

require_once( 'core.php' );
$t_core_path = config_get( 'core_path' );
require_once( $t_core_path.'bug_api.php' );
require_once( $t_core_path.'email_api.php' );
$t_subject = 'Issues requiring your attention';
$t_rem_body1 = 'The following issue(s) are awaiting your input';
$t_rem_body2 = 'Please do not reply to this message, use the helpdesk system itself';
//$project=24 ## ERP-Support;
$project=0;
$status=20;
$t_bug_table = config_get( 'mantis_bug_table' );
if ($project>0){
$query = "select id,reporter_id,project_id from $t_bug_table where status=$status and project_id=$project order by reporter_id";
} else{
$query = "select id,reporter_id,project_id from $t_bug_table where status=$status order by reporter_id";
}
$results = mysql_query( $query );
if ($results){
$start = true ;
$list= "";
// first group and store reminder per issue
while ($row1 = mysql_fetch_array($results, MYSQL_NUM)) {
$id = $row1[0];
$handler = $row1[1];
$project = $row1[2];
if ($start){
$handler2 = $handler ;
$start = false ;
}
if ($handler== $handler2){
$list .=" \n\n";
$list .= string_get_bug_view_url_with_fqdn( $id, $handler2 );
} else {
// now send the grouped email
$body = $t_rem_body1. " \n\n";
$body .= $list. " \n\n";
$body .= $t_rem_body2;
$result = email_group_reminder( $handler2, $body);
$handler2 = $handler ;
$list= string_get_bug_view_url_with_fqdn( $id, $handler2 );
}
}
// handle last grouped email
if ($results){
$body = $t_rem_body1. " \n\n";
$body .= $list. " \n\n";
$body .= $t_rem_body2;
$result = email_group_reminder( $handler2, $body);
}
}

Send Grouped reminder

function email_group_reminder( $p_user_id, $issues ) {
$t_username = user_get_field( $p_user_id, 'username' );
$t_email = user_get_email( $p_user_id );
$t_message = $issues ;
$t_subject = 'Issues requiring your attention';
if( !is_blank( $t_email ) ) {
email_send( $t_email, $t_subject, $t_message );
}
}