-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide an option to disable the emailing of receipts
Update Order.php - add new private static send_receipt - update the statusTransition method to allow for the disabling of receipt emails when orders are paid Update docs & example config Update OrderProcessor.php for missing config variables
- Loading branch information
1 parent
93c3fd3
commit 35e1884
Showing
5 changed files
with
36 additions
and
3 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
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 |
---|---|---|
|
@@ -54,6 +54,19 @@ public function testReceipt() | |
$this->assertEmailSent('[email protected]', '[email protected]'); | ||
} | ||
|
||
public function testReceiptNoEmailSent() | ||
{ | ||
$this->clearEmails(); | ||
Config::modify()->set(Order::class, 'send_receipt', false); | ||
$order = $this->objFromFixture(Order::class, 'unpaid'); | ||
$order->setField('Status', 'Paid'); | ||
$order->write(); | ||
$this->assertNull( | ||
$this->findEmail('[email protected]', '[email protected]'), | ||
'An email is not sent when the Order class send_receipt is set to false' | ||
); | ||
} | ||
|
||
public function testStatusUpdate() | ||
{ | ||
$this->notifier->sendStatusChange('test subject'); | ||
|