Skip to content

Commit

Permalink
From 3f43838 Mon Sep 17 00:00:00 2001
Browse files Browse the repository at this point in the history
From: Paul Richards <paul@mantisforge.org>
Date: Sun, 1 Sep 2013 19:54:16 +0100
Subject: [PATCH 379/449] as we store emails (for later delivery) no need to
 return a success value
  • Loading branch information
mantis committed Oct 9, 2013
1 parent b3148fe commit e3d7bd5
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions core/email_api.php
Expand Up @@ -571,10 +571,9 @@ function email_notify_new_account( $p_username, $p_email ) {
* @param int $p_message_id
* @param array $p_header_optional_params = null
* @param array $p_extra_user_ids_to_email
* @return bool
* @return null
*/
function email_generic( $p_bug_id, $p_notify_type, $p_message_id = null, $p_header_optional_params = null, $p_extra_user_ids_to_email = array() ) {
$t_ok = true;

if( ON === config_get( 'enable_email_notification' ) ) {
ignore_user_abort( true );
Expand All @@ -596,7 +595,7 @@ function email_generic( $p_bug_id, $p_notify_type, $p_message_id = null, $p_head
lang_push( user_pref_get_language( $t_user_id, $t_project_id ) );

$t_visible_bug_data = email_build_visible_bug_data( $t_user_id, $p_bug_id, $p_message_id );
$t_ok = email_bug_info_to_one_user( $t_visible_bug_data, $p_message_id, $t_project_id, $t_user_id, $p_header_optional_params ) && $t_ok;
email_bug_info_to_one_user( $t_visible_bug_data, $p_message_id, $t_project_id, $t_user_id, $p_header_optional_params );

lang_pop();
}
Expand All @@ -608,7 +607,7 @@ function email_generic( $p_bug_id, $p_notify_type, $p_message_id = null, $p_head
}
}

return $t_ok;
return;
}

/**
Expand Down Expand Up @@ -1201,15 +1200,15 @@ function email_bug_reminder( $p_recipients, $p_bug_id, $p_message ) {
* @param int $p_project_id
* @param int $p_user_id
* @param array $p_header_optional_params
* @return bool
* @return null
*/
function email_bug_info_to_one_user( $p_visible_bug_data, $p_message_id, $p_project_id, $p_user_id, $p_header_optional_params = null ) {
$t_user_email = user_get_email( $p_user_id );

# check whether email should be sent
# @@@ can be email field empty? if yes - then it should be handled here
if( ON !== config_get( 'enable_email_notification' ) || is_blank( $t_user_email ) ) {
return true;
return;
}

# build subject
Expand Down Expand Up @@ -1242,9 +1241,9 @@ function email_bug_info_to_one_user( $p_visible_bug_data, $p_message_id, $p_proj
}

# send mail
$t_ok = email_store( $t_user_email, $t_subject, $t_message, $t_mail_headers );
email_store( $t_user_email, $t_subject, $t_message, $t_mail_headers );

return $t_ok;
return;
}

/**
Expand Down

0 comments on commit e3d7bd5

Please sign in to comment.