-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added the ability to suppress the sending of confirmation emails for …
…quotes and orders in support of #373.
- Loading branch information
1 parent
ee167d4
commit 803f33f
Showing
4 changed files
with
17 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -391,7 +391,9 @@ public async Task<IActionResult> SubmitAsync(Order order) | |
// Send a confirmation email. | ||
if (submittedOrder) | ||
{ | ||
bool NoEmail = order.NoEmail; | ||
order = await Order.GetByIdAsync(order.OrderId, _postgresql).ConfigureAwait(false); | ||
order.NoEmail = NoEmail; | ||
|
||
// Submit the number orders and track the total cost. | ||
var onetimeItems = new List<Line_Items>(); | ||
|
@@ -1427,19 +1429,20 @@ Accelerate Networks | |
confirmationEmail.CalendarInvite = icalString; | ||
} | ||
|
||
// If there are notes on the order don't send out any emails to the customer. | ||
if (string.IsNullOrWhiteSpace(order.CustomerNotes)) | ||
// Suppress the confirmation emails. | ||
if (order.NoEmail) | ||
{ | ||
// Queue up the confirmation email. | ||
confirmationEmail.Completed = false; | ||
confirmationEmail.PrimaryEmailAddress = string.IsNullOrWhiteSpace(order.SalesEmail) ? "[email protected]" : order.SalesEmail; | ||
var checkSave = await confirmationEmail.PostAsync(_postgresql).ConfigureAwait(false); | ||
Log.Information($"Suppressed sending out the confirmation emails for {order.OrderId}."); | ||
} | ||
else | ||
{ | ||
// Queue up the confirmation email. | ||
confirmationEmail.Completed = false; | ||
confirmationEmail.PrimaryEmailAddress = string.IsNullOrWhiteSpace(order.SalesEmail) ? "[email protected]" : order.SalesEmail; | ||
var checkSave = await confirmationEmail.PostAsync(_postgresql).ConfigureAwait(false); | ||
Log.Information($"Skipped sending out the confirmation emails for {order.OrderId} due to customer notes."); | ||
Log.Information($"Sent out the confirmation emails for {order.OrderId}."); | ||
} | ||
|
||
// Allow the background work to commence. | ||
|
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