View Issue Details

IDProjectCategoryView StatusLast Update
0023892mantisbtemailpublic2018-01-26 11:58
Reporterkallelix Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Summary0023892: email queuing notifications don't account settings of 'from_email' and 'return_path_email' of project
Description

The email notifications don't account 'from_email' and 'return_path_email' of the project settings if email queuing is enabled ($g_email_send_using_cronjob = ON).

I upgraded from 1.2 to 2.1 and I found a hack of mine to solve this issue in the past for 1.2. I added code to get the project settings in function store_email::email_api.php and inject it in the metadata array. The old diff is below.

I wonder is there a better way to solve this in 2.1 or will there be a generell fix? For now I stay with $g_email_send_using_cronjob = OFF,which is far from ideal.

Additional Information
root@zapp:/var/www/mantis/core# diff email_api.php email_api.php.old
784c784
< function email_store( $p_recipient, $p_subject, $p_message, $p_headers = null, $p_project_id = null ) {
---
> function email_store( $p_recipient, $p_subject, $p_message, $p_headers = null ) {
803,808c803,804
<       // ###
<       $t_email_data->metadata['priority'] = config_get( 'mail_priority', null, null, $p_project_id );
<       $t_email_data->metadata['from_email'] = config_get( 'from_email', null, null, $p_project_id);
<       $t_email_data->metadata['return_path_email'] = config_get( 'return_path_email', null, null, $p_project_id);
<       $t_email_data->metadata['from_name'] = config_get( 'from_name', null, null, $p_project_id);
<       // ###end
---
>       $t_email_data->metadata['priority'] = config_get( 'mail_priority' );
>
942,967c938,941
<       // ### 
<       if (is_blank($t_email_data->metadata['from_email']))
<       {
<               $mail->From = config_get( 'from_email' );
<       }
<       else
<       {
<               $mail->From = $t_email_data->metadata['from_email'];
<       }
<       if (is_blank($t_email_data->metadata['return_path_email']))
<         {
<               $mail->Sender = config_get( 'return_path_email' );
<       }
<       else
<       {
<               $mail->Sender = $t_email_data->metadata['return_path_email'];
<       }
<       if (is_blank($t_email_data->metadata['from_name']))
<       {
<               $mail->FromName = config_get( 'from_name' );
<       }
<       else
<       {
<               $mail->FromName = $t_email_data->metadata['from_name'];
<       }
<       // ### END
---
>       $mail->From = config_get( 'from_email' );
>       $mail->Sender = config_get( 'return_path_email' );
>       $mail->FromName = config_get( 'from_name' );
>
1218,1219c1192
<       // ### added project
<       $t_ok = email_store( $t_user_email, $t_subject, $t_message, $t_mail_headers, $p_project_id );
---
>       $t_ok = email_store( $t_user_email, $t_subject, $t_message, $t_mail_headers );
TagsNo tags attached.
Attached Files

Activities

kallelix

kallelix

2018-01-26 06:35

reporter   ~0058615

diff is not readable in the message

email_api.php.diff (2,073 bytes)   
root@zapp:/var/www/mantis/core# diff email_api.php email_api.php.old
784c784
< function email_store( $p_recipient, $p_subject, $p_message, $p_headers = null, $p_project_id = null ) {
---
> function email_store( $p_recipient, $p_subject, $p_message, $p_headers = null ) {
803,808c803,804
<       // ###
<       $t_email_data->metadata['priority'] = config_get( 'mail_priority', null, null, $p_project_id );
<       $t_email_data->metadata['from_email'] = config_get( 'from_email', null, null, $p_project_id);
<       $t_email_data->metadata['return_path_email'] = config_get( 'return_path_email', null, null, $p_project_id);
<       $t_email_data->metadata['from_name'] = config_get( 'from_name', null, null, $p_project_id);
<       // ###end
---
>       $t_email_data->metadata['priority'] = config_get( 'mail_priority' );
>
942,967c938,941
<       // ###
<       if (is_blank($t_email_data->metadata['from_email']))
<       {
<               $mail->From = config_get( 'from_email' );
<       }
<       else
<       {
<               $mail->From = $t_email_data->metadata['from_email'];
<       }
<       if (is_blank($t_email_data->metadata['return_path_email']))
<         {
<               $mail->Sender = config_get( 'return_path_email' );
<       }
<       else
<       {
<               $mail->Sender = $t_email_data->metadata['return_path_email'];
<       }
<       if (is_blank($t_email_data->metadata['from_name']))
<       {
<               $mail->FromName = config_get( 'from_name' );
<       }
<       else
<       {
<               $mail->FromName = $t_email_data->metadata['from_name'];
<       }
<       // ### END
---
>       $mail->From = config_get( 'from_email' );
>       $mail->Sender = config_get( 'return_path_email' );
>       $mail->FromName = config_get( 'from_name' );
>
1218,1219c1192
<       // ###
<       $t_ok = email_store( $t_user_email, $t_subject, $t_message, $t_mail_headers, $p_project_id );
---
>       $t_ok = email_store( $t_user_email, $t_subject, $t_message, $t_mail_headers );
email_api.php.diff (2,073 bytes)   
dregad

dregad

2018-01-26 11:58

developer   ~0058625

diff is not readable in the message

fixed