CRM-16124 - is_email_receipt on complete_transaction should give precedence to
authorEileen McNaughton <eileen@fuzion.co.nz>
Tue, 17 Mar 2015 02:56:04 +0000 (15:56 +1300)
committerEileen McNaughton <eileen@fuzion.co.nz>
Tue, 17 Mar 2015 04:32:19 +0000 (17:32 +1300)
Conflicts:
CRM/Core/Payment/BaseIPN.php

CRM/Core/Payment/BaseIPN.php

index f5f2aad4a952719723a6736d45910ec7662a2eb3..4cfe9ab88dc6e64640a2171cb7266b7a75ed5cad 100644 (file)
@@ -438,6 +438,9 @@ class CRM_Core_Payment_BaseIPN {
     $recurContrib = &$objects['contributionRecur'];
 
     $values = array();
+    if (isset($input['is_email_receipt'])) {
+      $values['is_email_receipt'] = $input['is_email_receipt'];
+    }
     $source = NULL;
     if ($input['component'] == 'contribute') {
       if ($contribution->contribution_page_id) {
@@ -453,8 +456,10 @@ class CRM_Core_Payment_BaseIPN {
         $values['receipt_from_name'] = $domainValues[0];
         $values['receipt_from_email'] = $domainValues[1];
       }
-      if ($recurContrib && $recurContrib->id) {
+
+      if ($recurContrib && $recurContrib->id && !isset($input['is_email_receipt'])) {
         //CRM-13273 - is_email_receipt setting on recurring contribution should take precedence over contribution page setting
+        // but CRM-16124 if $input['is_email_receipt'] is set then that should not be overridden.
         $values['is_email_receipt'] = $recurContrib->is_email_receipt;
       }