User can't receive email if status changes to the customized
Moderators: Developer, Contributor
User can't receive email if status changes to the customized
Hello moderator,
I want to add some statuses of issue into MantisBT.So I read the corresponding chapters of "Mantis Bug Tracker Administration Guide",and do the following things,
1.I created "custom_constants_inc.php" and located it into the main MantisBT directory.The content of this file is,
<?php
# Custom status code
define( 'disputed', 60 );
define( 'rejected', 100 );
define( 'committed', 70 );
define( 'failed', 75 );
?>
I wanted add these 4 statuses into MantisBT.
2.In "config_inc.php",I defined the new statuses in the enumeration and their color codes.
# Revised enum string with new 4 statuses
$g_status_enum_string = '10:new,20:feedback,30:acknowledged,40:confirmed,50:assigned,60:disputed,70:committed,75:failed,80:resolved,90:closed,100:rejected';
# Status color additions
$g_status_colors['disputed'] = '#FF00FF';
$g_status_colors['committed'] = '#4D4DFF';
$g_status_colors['failed'] = '#BC1717';
$g_status_colors['rejected'] = '#A67D3D';
3.I created "custom_strings_inc.php" and located it into the main MantisBT directory.The content of this file is,
<?php
switch( $g_active_language ) {
case 'chinese_simplified':
$s_status_enum_string = '10:新建,20:反馈,30:认可,40:已确认,50:已分派,60:有争议,70:已提交,75:验证失败,80:已解决,90:已关闭,100:已拒绝';
//用于自定义状态“有争议”的字符串
$s_disputed_bug_title = '此问题有争议';
$s_disputed_bug_button = '存在争议';
$s_email_notification_title_for_status_bug_disputed = '下列问题有争议';
//用于自定义状态“已提交”的字符串
$s_committed_bug_title = '问题的修复已提交';
$s_committed_bug_button = '已提交';
$s_email_notification_title_for_status_bug_committed = '下列问题的修复已提交';
//用于自定义状态“验证失败”的字符串
$s_failed_bug_title = '验证失败';
$s_failed_bug_button = '验证失败';
$s_email_notification_title_for_status_bug_failed = '下列问题验证失败';
//用于自定义状态“已拒绝”的字符串
$s_rejected_bug_title = '拒绝修改';
$s_rejected_bug_button = '拒绝修改';
$s_email_notification_title_for_status_bug_rejected = '下列问题被拒绝修改';
break;
default: # english
$s_status_enum_string = '10:new,20:feedback,30:acknowledged,40:confirmed,50:assigned,60:disputed,70:committed,75:failed,80:resolved,90:closed,100:rejected';
//Strings to the customized status "disputed"
$s_disputed_bug_title = 'Disputation Exists';
$s_disputed_bug_button = 'Disputation Exists';
$s_email_notification_title_for_status_bug_disputed = 'The following issue is DISPUTED.';
//Strings to the customized status "committed"
$s_committed_bug_title = 'Code to fix this issue has been committed';
$s_committed_bug_button = 'Be Committed';
$s_email_notification_title_for_status_bug_committed = 'Code to fix the following issue has been COMMITTED.';
//Strings to the customized status “failed”
$s_failed_bug_title = 'Failed in the verification';
$s_failed_bug_button = 'Failed';
$s_email_notification_title_for_status_bug_failed = 'The following issue has been failed in the verification.';
//Strings to the customized status “rejected”
$s_rejected_bug_title = 'Reject to fix';
$s_rejected_bug_button = 'Reject to fix';
$s_email_notification_title_for_status_bug_rejected = 'The following issue has been rejected to fix.';
break;
}
?>
4.I navigated to "Manage"-"Manage Configuration"-"Workflow Transitions" and did some settings,as follows, 5.Then I navigated to "Manage"-"Manage Configuration"-"E-mail Notifications" and did some settings,as follows, In the above picture,CMO is customized by me.
Now I met a problem.If I set the status of an issue to disputed,committed and failed,corresponding users can't receive any e-mail.If I set the status of an issue to rejected,user can get an e-mail,but the title isn't $s_email_notification_title_for_status_bug_rejected but $s_email_notification_title_for_status_bug_closed.
Could you help me to point my errors?Thank you very much!
I did these under MantisBT V1.2.14 and XAMPP win32-1.7.4.
I want to add some statuses of issue into MantisBT.So I read the corresponding chapters of "Mantis Bug Tracker Administration Guide",and do the following things,
1.I created "custom_constants_inc.php" and located it into the main MantisBT directory.The content of this file is,
<?php
# Custom status code
define( 'disputed', 60 );
define( 'rejected', 100 );
define( 'committed', 70 );
define( 'failed', 75 );
?>
I wanted add these 4 statuses into MantisBT.
2.In "config_inc.php",I defined the new statuses in the enumeration and their color codes.
# Revised enum string with new 4 statuses
$g_status_enum_string = '10:new,20:feedback,30:acknowledged,40:confirmed,50:assigned,60:disputed,70:committed,75:failed,80:resolved,90:closed,100:rejected';
# Status color additions
$g_status_colors['disputed'] = '#FF00FF';
$g_status_colors['committed'] = '#4D4DFF';
$g_status_colors['failed'] = '#BC1717';
$g_status_colors['rejected'] = '#A67D3D';
3.I created "custom_strings_inc.php" and located it into the main MantisBT directory.The content of this file is,
<?php
switch( $g_active_language ) {
case 'chinese_simplified':
$s_status_enum_string = '10:新建,20:反馈,30:认可,40:已确认,50:已分派,60:有争议,70:已提交,75:验证失败,80:已解决,90:已关闭,100:已拒绝';
//用于自定义状态“有争议”的字符串
$s_disputed_bug_title = '此问题有争议';
$s_disputed_bug_button = '存在争议';
$s_email_notification_title_for_status_bug_disputed = '下列问题有争议';
//用于自定义状态“已提交”的字符串
$s_committed_bug_title = '问题的修复已提交';
$s_committed_bug_button = '已提交';
$s_email_notification_title_for_status_bug_committed = '下列问题的修复已提交';
//用于自定义状态“验证失败”的字符串
$s_failed_bug_title = '验证失败';
$s_failed_bug_button = '验证失败';
$s_email_notification_title_for_status_bug_failed = '下列问题验证失败';
//用于自定义状态“已拒绝”的字符串
$s_rejected_bug_title = '拒绝修改';
$s_rejected_bug_button = '拒绝修改';
$s_email_notification_title_for_status_bug_rejected = '下列问题被拒绝修改';
break;
default: # english
$s_status_enum_string = '10:new,20:feedback,30:acknowledged,40:confirmed,50:assigned,60:disputed,70:committed,75:failed,80:resolved,90:closed,100:rejected';
//Strings to the customized status "disputed"
$s_disputed_bug_title = 'Disputation Exists';
$s_disputed_bug_button = 'Disputation Exists';
$s_email_notification_title_for_status_bug_disputed = 'The following issue is DISPUTED.';
//Strings to the customized status "committed"
$s_committed_bug_title = 'Code to fix this issue has been committed';
$s_committed_bug_button = 'Be Committed';
$s_email_notification_title_for_status_bug_committed = 'Code to fix the following issue has been COMMITTED.';
//Strings to the customized status “failed”
$s_failed_bug_title = 'Failed in the verification';
$s_failed_bug_button = 'Failed';
$s_email_notification_title_for_status_bug_failed = 'The following issue has been failed in the verification.';
//Strings to the customized status “rejected”
$s_rejected_bug_title = 'Reject to fix';
$s_rejected_bug_button = 'Reject to fix';
$s_email_notification_title_for_status_bug_rejected = 'The following issue has been rejected to fix.';
break;
}
?>
4.I navigated to "Manage"-"Manage Configuration"-"Workflow Transitions" and did some settings,as follows, 5.Then I navigated to "Manage"-"Manage Configuration"-"E-mail Notifications" and did some settings,as follows, In the above picture,CMO is customized by me.
Now I met a problem.If I set the status of an issue to disputed,committed and failed,corresponding users can't receive any e-mail.If I set the status of an issue to rejected,user can get an e-mail,but the title isn't $s_email_notification_title_for_status_bug_rejected but $s_email_notification_title_for_status_bug_closed.
Could you help me to point my errors?Thank you very much!
I did these under MantisBT V1.2.14 and XAMPP win32-1.7.4.
Re: User can't receive email if status changes to the custom
This happens because rejected is >= setting bug_closed_status_threshold (closed is the default for it)
The easiest way to fix this is to changetoand change also the other references from 100 to 85
The easiest way to fix this is to change
Code: Select all
$g_status_enum_string = '10:new,20:feedback,30:acknowledged,40:confirmed,50:assigned,60:disputed,70:committed,75:failed,80:resolved,90:closed,100:rejected';
Code: Select all
$g_status_enum_string = '10:new,20:feedback,30:acknowledged,40:confirmed,50:assigned,60:disputed,70:committed,75:failed,80:resolved,85:rejected,90:closed';
Re: User can't receive email if status changes to the custom
Hello moderator,
I have changed the status "rejected" from 100 to 85 in each reference.But when I change the status of an issue to "rejected",corresponding users receive an email whose title isn't $s_email_notification_title_for_status_bug_rejected but $s_email_notification_title_for_status_bug_resolved.And if I change the status to "disputed","committed" or "failed",still no emails are received.
I have changed the status "rejected" from 100 to 85 in each reference.But when I change the status of an issue to "rejected",corresponding users receive an email whose title isn't $s_email_notification_title_for_status_bug_rejected but $s_email_notification_title_for_status_bug_resolved.And if I change the status to "disputed","committed" or "failed",still no emails are received.
Re: User can't receive email if status changes to the custom
I didn't consider that there is also a setting bug_resolved_status_threshold (default resolved)
This should work
Check also that your users have enabled "E-mail on status changes" on page "My Account" > "Preferences"
This should work
Code: Select all
$g_status_enum_string = '10:new,20:feedback,30:acknowledged,40:confirmed,50:assigned,60:disputed,70:committed,75:failed,78:rejected,80:resolved,90:closed';
Re: User can't receive email if status changes to the custom
Thank you very much!Now it works.I didn't enable "E-mail on Status Change" formerly.
Now I have another question.I have read this section,"MantisBT assumes that an issue can be in one of three stages: opened, resolved and closed. Hence, the customized statuses list will be mapped to these three stages. For example, MantisBT comes out of the box with the following statuses: new, feedback, acknowledged, confirmed, assigned, resolved and closed. In this case "new" -> "assigned" map to opened, "resolved" means resolved and "closed" means closed.",from the "Mantis Bug Tracker Administration Guide".
Now I want to realize this mapping to the 4 customized statuses,too.I want,
"10:new,20:feedback,30:acknowledged,40:confirmed,50:assigned,60:disputed,70:committed,75:failed",these statuses map to opened,
"80:resolved" maps to resolved,
"78:rejected,90:closed",these 2 statuses map to "closed".
How can I realize it?Thank you very much!
Now I have another question.I have read this section,"MantisBT assumes that an issue can be in one of three stages: opened, resolved and closed. Hence, the customized statuses list will be mapped to these three stages. For example, MantisBT comes out of the box with the following statuses: new, feedback, acknowledged, confirmed, assigned, resolved and closed. In this case "new" -> "assigned" map to opened, "resolved" means resolved and "closed" means closed.",from the "Mantis Bug Tracker Administration Guide".
Now I want to realize this mapping to the 4 customized statuses,too.I want,
"10:new,20:feedback,30:acknowledged,40:confirmed,50:assigned,60:disputed,70:committed,75:failed",these statuses map to opened,
"80:resolved" maps to resolved,
"78:rejected,90:closed",these 2 statuses map to "closed".
How can I realize it?Thank you very much!
Re: User can't receive email if status changes to the custom
You can get it by setting
90:closed,95:rejected
But after this change you will get again the e-mail message $s_email_notification_title_for_status_bug_closed
The rule is
status >= bug_closed_status_threshold : send $s_email_notification_title_for_status_bug_closed
status >= bug_resolved_status_threshold : send $s_email_notification_title_for_status_bug_resolved
else send $s_email_notification_title_for_status_bug_<yourStatus>
This is probably a questionable behavior, but it's the way it's implemented at the moment in MantisBT.
90:closed,95:rejected
But after this change you will get again the e-mail message $s_email_notification_title_for_status_bug_closed
The rule is
status >= bug_closed_status_threshold : send $s_email_notification_title_for_status_bug_closed
status >= bug_resolved_status_threshold : send $s_email_notification_title_for_status_bug_resolved
else send $s_email_notification_title_for_status_bug_<yourStatus>
This is probably a questionable behavior, but it's the way it's implemented at the moment in MantisBT.
Re: User can't receive email if status changes to the custom
Thank you!I still have a question,
If I confirm an issue and I don't assign it to others,corresponding users will get an email whose title is $s_email_notification_title_for_status_bug_confirmed,but if I assign it to another user in "Confirm Issue" page,he will get an email whose title is $s_email_notification_title_for_action_bug_assigned.Can the title still be $s_email_notification_title_for_status_bug_confirmed at this moment?
If I confirm an issue and I don't assign it to others,corresponding users will get an email whose title is $s_email_notification_title_for_status_bug_confirmed,but if I assign it to another user in "Confirm Issue" page,he will get an email whose title is $s_email_notification_title_for_action_bug_assigned.Can the title still be $s_email_notification_title_for_status_bug_confirmed at this moment?
- Attachments
-
- confirm.JPG (23.17 KiB) Viewed 7039259 times
Re: User can't receive email if status changes to the custom
This is not possible without changing the source code.
Might be a solution for you
http://www.mantisbt.org/bugs/view.php?id=13485#c37640
Might be a solution for you
http://www.mantisbt.org/bugs/view.php?id=13485#c37640
Re: User can't receive email if status changes to the custom
Thank you!But which file should I modify if I want to change the source code?
Re: User can't receive email if status changes to the custom
You have to change function update in file core/bug_api.php
Replace this piece of code
by
Be aware that this is not exactly what you want.
You have to read the whole story http://www.mantisbt.org/bugs/view.php?id=13485 to understand what will be changed.
Replace this piece of code
Code: Select all
# bug assigned
if( $t_old_data->handler_id != $this->handler_id ) {
email_generic( $c_bug_id, 'owner', 'email_notification_title_for_action_bug_assigned' );
return true;
}
# status changed
if( $t_old_data->status != $this->status ) {
$t_status = MantisEnum::getLabel( config_get( 'status_enum_string' ), $this->status );
$t_status = str_replace( ' ', '_', $t_status );
email_generic( $c_bug_id, $t_status, 'email_notification_title_for_status_bug_' . $t_status );
return true;
}
# @todo handle priority change if it requires special handling
# generic update notification
email_generic( $c_bug_id, 'updated', 'email_notification_title_for_action_bug_updated' );
Code: Select all
$t_email_sent = false;
# bug assigned
if( $t_old_data->handler_id != $this->handler_id ) {
email_generic( $c_bug_id, 'owner', 'email_notification_title_for_action_bug_assigned' );
$t_email_sent = true;
}
# status changed
if( $t_old_data->status != $this->status ) {
$t_status = MantisEnum::getLabel( config_get( 'status_enum_string' ), $this->status );
$t_status = str_replace( ' ', '_', $t_status );
email_generic( $c_bug_id, $t_status, 'email_notification_title_for_status_bug_' . $t_status );
$t_email_sent = true;
}
# @todo handle priority change if it requires special handling
# generic update notification
if ( !$t_email_sent ) email_generic( $c_bug_id, 'updated', 'email_notification_title_for_action_bug_updated' );
You have to read the whole story http://www.mantisbt.org/bugs/view.php?id=13485 to understand what will be changed.
Re: User can't receive email if status changes to the custom
Thank you,moderator!I have just exchanged the position of "bug assigned" and "status changed".Now users can get an email whose ttitle is $s_email_notification_title_for_status_bug_XXXX.
- Attachments
-
- email.JPG (65.71 KiB) Viewed 7039049 times