EmailReporting 0.10.1
I added these two lines of code in mail_api.php but they don't seem to be doing anything in Mantis. We are trying to add a custom email address read from the body text of an incoming bug report via email. What am I doing wrong? The incoming email body text contains a line like this: blahblah Client someEmail@domain.com blahblah
Code: Select all
private function parse_content( &$p_msg )
{
$this->show_memory_usage( 'Start Mail Parser' );
$t_mp = new ERP_Mail_Parser( $this->_mp_options, $this->_mailbox_starttime );
$t_mp->setInputString( $p_msg );
if ( $this->_mail_add_complete_email )
{
$t_part = array(
'name' => 'Complete email.txt',
'ctype' => 'text/plain',
'body' => $p_msg,
);
}
preg_match('/Client\s(.+)\@(.+)\s/', $t_part['body'], $pmatch); # ADDED THIS HERE
if ($pmatch[1] !== "") { $t_email[ 'Cc' ] = $pmatch[1] . "@" . $pmatch[2]; } # ADDED THIS HERE
$p_msg = NULL;
$t_mp->parse();
$t_email[ 'From_parsed' ] = $this->parse_from_field( trim( $t_mp->from() ) );
$t_email[ 'Reporter_id' ] = $this->get_user( $t_email[ 'From_parsed' ] );
$t_email[ 'Subject' ] = trim( $t_mp->subject() );
$t_email[ 'To' ] = $this->get_emailaddr_from_string( $t_mp->to() );
# $t_email[ 'Cc' ] = $this->get_emailaddr_from_string( $t_mp->cc() ); # COMMENTED THIS LINE OUT
$t_email[ 'X-Mantis-Body' ] = trim( $t_mp->body() );
$t_email[ 'X-Mantis-Parts' ] = $t_mp->parts();