Details
Description
This bug was reproduced on CCRM 4.3.4 on Wordpress 3.5.1 when using the SOAP api via the CiviSMTP service.
Replies are not going through when being processed through SOAP when the 'replyTo' param is empty (we have to be able to pass it as empty for backwards compatibility with older versions of CCRM).
This is happening due to 'replyTo' param being required in the spec in civicrm/api/v3/Mailing.php
function _civicrm_api3_mailing_event_reply_spec
and the code fails in civicrm/api/api.php line 58 during civicrm_api3_verify_mandatory call when checking for required params.
However during the actual processing of the reply 'replyTo' is not required - see CRM/Mailing/Event/BAO/Reply.php line 60
public static function &reply($job_id, $queue_id, $hash, $replyto = NULL)
and if not provided is being parsed from the email body or taken out of db results - see CRM_Mailing_Event_BAO_Reply::send line 138 and line 176
Proposed fix is to set 'replyTo' to not be required in api/v3/Mailing.php line: 161
-
-
- Mailing.php 2013-07-15 18:52:09.000000000 -0500
- Mailing.php.orig 2013-07-15 18:52:02.000000000 -0500
***************
- 162,168 ****
$params['job_id']['api.required'] = 1;
$params['event_queue_id']['api.required'] = 1;
$params['hash']['api.required'] = 1;
! $params['replyTo']['api.required'] = 0;
}
-
/**
— 162,168 ----
$params['job_id']['api.required'] = 1;
$params['event_queue_id']['api.required'] = 1;
$params['hash']['api.required'] = 1;
! $params['replyTo']['api.required'] = 1;
}
/**
Additionally there are 2 more issues related to this:
1. CRM_Mailing_Event_BAO_Reply::send line 138 - see correction below
138c138
< $parsed->setHeader('Reply-To', (!($replyto instanceof ezcMailAddress)) ? $parsed->from->__toString() : $replyto);
—
> $parsed->setHeader('Reply-To', $replyto instanceof ezcMailAddress ? $parsed->from->__toString() : $replyto);
2. This one I cannot test since not sure how the code gets here but believe on line 176 it should be $eq->email instead of $dao:
176c176
< 'Reply-To' => empty($replyto) ? $eq->email : $replyto,
—
> 'Reply-To' => empty($replyto) ? $dao->email : $replyto,