$this->callAPISuccess('Payment', 'sendconfirmation', ['id' => $payment['id']]);
$mut->assertSubjects(['Payment Receipt - Annual CiviCRM meet']);
$mut->checkMailLog([
+ 'From: "FIXME" <info@EXAMPLE.ORG>',
'Dear Anthony,',
'Total Fees: $ 300.00',
'This Payment Amount: $ 50.00',
*/
public function testPaymentEmailReceiptFullyPaid() {
$mut = new CiviMailUtils($this);
+ CRM_Core_Config::singleton()->userPermissionClass->permissions = ['access CiviContribute', 'edit contributions', 'access CiviCRM'];
list($lineItems, $contribution) = $this->createParticipantWithContribution();
$params = [
];
$payment = $this->callAPISuccess('payment', 'create', $params);
- $this->callAPISuccess('Payment', 'sendconfirmation', ['id' => $payment['id']]);
+ // Here we set the email to an invalid email & use check_permissions, domain email should be used.
+ $email = $this->callAPISuccess('Email', 'create', ['contact_id' => 1, 'email' => 'bob@example.com']);
+ $this->callAPISuccess('Payment', 'sendconfirmation', ['id' => $payment['id'], 'from' => $email['id'], 'check_permissions' => 1]);
$mut->assertSubjects(['Payment Receipt - Annual CiviCRM meet', 'Registration Confirmation - Annual CiviCRM meet']);
$mut->checkMailLog([
+ 'From: "FIXME" <info@EXAMPLE.ORG>',
'Dear Anthony,',
'A payment has been received.',
'Total Fees: $ 300.00',
'This Payment Amount: $ 150.00',
'Balance Owed: $ 0.00',
- 'Thank you for completing payment.',
+ 'Thank you for completing this payment.',
]);
$mut->stop();
$mut->clearMessages();