-
-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CRM-19710 - Preserve is_email_receipt parameter through to email sent #9487
Closed
Closed
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
b1f7f21
Add is_email_receipt parameter to sendconfirmation API parameters to …
agileware-dev 52ba942
Set is_email_confirm based on is_email_receipt input override argumen…
agileware-dev 4902dd3
Store values arguments so they can be used during array_merge after u…
agileware-dev c5e7b19
Include is_email_receipt as allowedParam in sendconfirmation.
agileware-dev 6959b82
Add is_email_receipt as a whitelist input.
agileware-dev 0432467
Set is_email_receipt parameter for sendconfirmation to 0 if the array…
agileware-dev 6c365b9
Test for CRM-19710
agileware-dev ca0fc4d
Use CRM_Utils_Array::value to check is_email_receipt
agileware-dev ce709b9
Minor change to remote tags from test checkMailLog
agileware-dev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
|
@@ -2305,6 +2305,36 @@ public function testCompleteTransactionWithEmailReceiptInput() { | |
$this->assertEquals('', $receipt_date); | ||
} | ||
|
||
/** | ||
* CRM-19710 - Test to ensure that completetransaction respects the is_email_receipt setting, overriding default from contrib 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. | ||
*/ | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@agileware Can we assign
$values
after_gatherMessageValues()
is done similar toreceipt_date
? Since we could avoid defining$tmp_values
in that case.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes we can, but if any extra options are passed through in
$values
that differ from any options after_gatherMessageValues()
, they'll be lost anyway.e.g. If
receipt_from_email
is passed along in$values
, but differs from whatever is retrieved after_gatherMessageValues()
.Not sure if/when this would ever be a problem. If you think it's not an issue, let me know and we'll adjust the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's ditch this bit because I feel it's blocking the PR. That function is only called from here & ideally it would be dismantled into the calling function in bits e.g
extract this
into a function & call from composeMessageArray, ideally with tests, and possibly some review of how consistently that address token is used.
slow & painful, yes.