Add status to email subject

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
bartoszx

Add status to email subject

Post by bartoszx »

Hi
I wonder if I can add word "RESOLVED" to confirmation email subject when changing status to resolved.
We use mantis to manage websites updates. I want my clients to see in email subject that bug/issue was resolved.

Thanks in advance

ver 1.0.0rc1
bartoszx

Post by bartoszx »

I am posting this little modufication here
v1.0.0rc1
edit core/email_api.php
at line 861 add

Code: Select all

$t_status = $p_visible_bug_data['email_status'];
$p_visible_bug_data['email_status'] = get_enum_element( 'status', $t_status );

then change after  # build subject
$t_subject = '['.$p_visible_bug_data['email_project'].' '
                       .bug_format_id( $p_visible_bug_data['email_bug'] )
                        .']:'.$email_subject_status.':'.$p_visible_bug_data['email_summary'];
kp
Posts: 2
Joined: 12 Sep 2005, 12:44

Correction

Post by kp »

The code above resets $p_visible_bug_data['email_status'] but then uses $email_subject_status. which isn't a desired result and doesn't work. I think the code should read:

Add:

Code: Select all

$t_status = $p_visible_bug_data ['email_status'];
$email_subject_status = strtoupper(get_enum_element( 'status', $t_status ));
Change after # build subject

Code: Select all

$t_subject = '['.$p_visible_bug_data['email_project'].' '
			.bug_format_id( $p_visible_bug_data['email_bug'] )
			.'] '.$email_subject_status.': '.$p_visible_bug_data['email_summary'];

It looks like this was just a typo.

By the way... the modifications to the forum that translate any number sign followed by digits makes posting code extremely difficult. The forum software automatically converts special characters to ascii equivalent digits thus replacing stuff like brackets with ascii code 91 which then gets converted as a link to the bug tracker. I'd request this get turned off, it's not so hard to post a link manually. But it's impossible to post readable code.
bartoszx

Post by bartoszx »

Yes that was just a typo
Thanks for correction
Regards
Post Reply