-
-
Notifications
You must be signed in to change notification settings - Fork 824
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10000 from eileenmcnaughton/agile
CRM-19710 - Preserve is_email_receipt parameter through to email sent
- Loading branch information
Showing
3 changed files
with
87 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2473,6 +2473,37 @@ public function testCompleteTransactionForRecurring() { | |
$this->mut->stop(); | ||
$this->revertTemplateToReservedTemplate(); | ||
} | ||
/** | ||
* CRM-19710 - Test to ensure that completetransaction respects the input for is_email_receipt setting. | ||
* | ||
* If passed in it will override the default from contribution page. | ||
*/ | ||
public function testCompleteTransactionWithEmailReceiptInputTrue() { | ||
$mut = new CiviMailUtils($this, TRUE); | ||
$this->createLoggedInUser(); | ||
// Create a Contribution Page with is_email_receipt = FALSE | ||
$contributionPage = $this->callAPISuccess('ContributionPage', 'create', array( | ||
'receipt_from_name' => 'Mickey Mouse', | ||
'receipt_from_email' => '[email protected]', | ||
'title' => "Test Contribution Page", | ||
'financial_type_id' => 1, | ||
'currency' => 'CAD', | ||
'is_monetary' => TRUE, | ||
'is_email_receipt' => 0, | ||
)); | ||
$this->_params['contribution_page_id'] = $contributionPage['id']; | ||
$params = array_merge($this->_params, array('contribution_status_id' => 2, 'receipt_date' => 'now')); | ||
$contribution = $this->callAPISuccess('contribution', 'create', $params); | ||
// Complete the transaction overriding is_email_receipt to = TRUE | ||
$this->callAPISuccess('contribution', 'completetransaction', array( | ||
'id' => $contribution['id'], | ||
'is_email_receipt' => 1, | ||
)); | ||
$mut->checkMailLog(array( | ||
'Please print this receipt for your records.', | ||
)); | ||
$mut->stop(); | ||
} | ||
|
||
/** | ||
* Complete the transaction using the template with all the possible. | ||
|