Skip to content
Permalink
Browse files

Add plugin event for e-mail subject customization

New event: EVENT_DISPLAY_EMAIL_BUILD_SUBJECT

Fixes #15648
  • Loading branch information
dregad committed Apr 19, 2013
2 parents cbc4037 + d75c2fb commit 4090050b8cef90b9c632ff22b1dc2dff681ae073
Showing with 11 additions and 4 deletions.
  1. +10 −4 core/email_api.php
  2. +1 −0 core/events_inc.php
@@ -1070,10 +1070,16 @@ function email_build_subject( $p_bug_id ) {
# grab the subject (summary)
$p_subject = bug_get_field( $p_bug_id, 'summary' );

# padd the bug id with zeros
$p_bug_id = bug_format_id( $p_bug_id );
# pad the bug id with zeros
$t_bug_id = bug_format_id( $p_bug_id );

return '[' . $p_project_name . ' ' . $p_bug_id . ']: ' . $p_subject;
# build standard subject string
$t_email_subject = "[$p_project_name $t_bug_id]: $p_subject";

# update subject as defined by plugins
$t_email_subject = event_signal( 'EVENT_DISPLAY_EMAIL_BUILD_SUBJECT', $t_email_subject, array( 'bug_id' => $p_bug_id ) );

return $t_email_subject;
}

/**
@@ -1186,7 +1192,7 @@ function email_bug_info_to_one_user( $p_visible_bug_data, $p_message_id, $p_proj
}

# build subject
$t_subject = '[' . $p_visible_bug_data['email_project'] . ' ' . bug_format_id( $p_visible_bug_data['email_bug'] ) . ']: ' . $p_visible_bug_data['email_summary'];
$t_subject = email_build_subject($p_visible_bug_data['email_bug']);

# build message

@@ -41,6 +41,7 @@
'EVENT_DISPLAY_FORMATTED' => EVENT_TYPE_CHAIN,
'EVENT_DISPLAY_RSS' => EVENT_TYPE_CHAIN,
'EVENT_DISPLAY_EMAIL' => EVENT_TYPE_CHAIN,
'EVENT_DISPLAY_EMAIL_BUILD_SUBJECT' => EVENT_TYPE_CHAIN,

# Menu Events
'EVENT_MENU_MAIN' => EVENT_TYPE_DEFAULT,

0 comments on commit 4090050

Please sign in to comment.
You can’t perform that action at this time.