CRM-13057
authorDonald A. Lobo <lobo@civicrm.org>
Thu, 25 Jul 2013 22:29:36 +0000 (15:29 -0700)
committerDonald A. Lobo <lobo@civicrm.org>
Thu, 25 Jul 2013 22:29:36 +0000 (15:29 -0700)
----------------------------------------
* CRM-13057: Replies to mailings processed through SOAP are failing
  http://issues.civicrm.org/jira/browse/CRM-13057

CRM/Mailing/Event/BAO/Reply.php
api/v3/Mailing.php

index eeeda636c307f11422ff4ba754b11383d344ce37..59034e1baa166005f469a039cc48419b7d107340 100644 (file)
@@ -72,8 +72,8 @@ class CRM_Mailing_Event_BAO_Reply extends CRM_Mailing_Event_DAO_Reply {
     $mailings = CRM_Mailing_BAO_Mailing::getTableName();
     $jobs = CRM_Mailing_BAO_Job::getTableName();
     $mailing->query(
-      "SELECT * FROM  $mailings 
-            INNER JOIN      $jobs 
+      "SELECT * FROM  $mailings
+            INNER JOIN      $jobs
                 ON          $jobs.mailing_id = $mailings.id
             WHERE           $jobs.id = {$q->job_id}"
     );
@@ -135,7 +135,7 @@ class CRM_Mailing_Event_BAO_Reply extends CRM_Mailing_Event_DAO_Reply {
 
       // CRM-5567: we need to set Reply-To: so that any response
       // to the forward goes to the sender of the reply
-      $parsed->setHeader('Reply-To', $replyto instanceof ezcMailAddress ? $parsed->from->__toString() : $replyto);
+      $parsed->setHeader('Reply-To', $replyto instanceof ezcMailAddress ? $replyto : $parsed->from->__toString());
 
       // $h must be an array, so we can't use generateHeaders()'s result,
       // but we have to regenerate the headers because we changed To
@@ -173,7 +173,7 @@ class CRM_Mailing_Event_BAO_Reply extends CRM_Mailing_Event_DAO_Reply {
         'Subject' => "Re: {$mailing->subject}",
         'To' => $mailing->replyto_email,
         'From' => $from,
-        'Reply-To' => empty($replyto) ? $dao->email : $replyto,
+        'Reply-To' => empty($replyto) ? $eq->email : $replyto,
         'Return-Path' => "do-not-reply@{$emailDomain}",
       );
 
index 44a6f6a579fa83e1309087e1220513d3f972f11e..42504f284d5095430fbf36b775a1f3f7fe36f793 100644 (file)
@@ -162,7 +162,7 @@ function _civicrm_api3_mailing_event_reply_spec(&$params) {
   $params['job_id']['api.required'] = 1;
   $params['event_queue_id']['api.required'] = 1;
   $params['hash']['api.required'] = 1;
-  $params['replyTo']['api.required'] = 1;
+  $params['replyTo']['api.required'] = 0;
 }
 
 /**