-
Notifications
You must be signed in to change notification settings - Fork 4
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 #284 from GregFinzer/feature/EmailQueueLogic
Feature/email queue logic
- Loading branch information
Showing
30 changed files
with
3,012 additions
and
340 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,45 @@ | ||
@page "/administration/admin/email" | ||
@layout BedBrigade.Client.Shared.AdminLayout | ||
@page "/administration/admin/email" | ||
@inject IEmailQueueLogic EmailQueueLogic; | ||
@attribute [Authorize(Roles = RoleNames.CanSendBulkEmail)] | ||
|
||
<h3>Send Email</h3> | ||
|
||
<EditForm Model="@email" OnValidSubmit="@HandleSubmit"> | ||
<div class="form-group"> | ||
<label for="to">To:</label> | ||
<InputText id="to" class="form-control" @bind-Value="email.ToAddress" /> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<label for="subject">Subject:</label> | ||
<InputText id="subject" class="form-control" @bind-Value="email.Subject" /> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<label for="body">Body:</label> | ||
<InputTextArea id="body" class="form-control" @bind-Value="email.Body"></InputTextArea> | ||
</div> | ||
|
||
<button type="submit" class="btn btn-primary">Submit</button> | ||
<button type="button" class="btn btn-secondary" @onclick="ProcessQueue">Process Queue</button> | ||
</EditForm> | ||
|
||
|
||
|
||
<h3 class="w-100 text-center my-4">Email</h3> | ||
|
||
@code { | ||
private EmailQueue email = new EmailQueue(); | ||
|
||
private async Task HandleSubmit() | ||
{ | ||
await EmailQueueLogic.QueueEmail(email); | ||
// // Logic to send email. For simplicity, we'll just print to console for now. | ||
// Console.WriteLine($"Sending email to: {email.To}, Subject: {email.Subject}, Body: {email.Body}"); | ||
} | ||
|
||
} | ||
private async Task ProcessQueue() | ||
{ | ||
EmailQueueLogic.ProcessQueue(email); | ||
} | ||
} |
6 changes: 0 additions & 6 deletions
6
BedBrigade.Client/Pages/Administration/AdminTasks/Email.razor
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace BedBrigade.Common | ||
{ | ||
public enum EmailQueueStatus | ||
{ | ||
Queued, | ||
Locked, | ||
Sent, | ||
Failed | ||
} | ||
} |
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
Oops, something went wrong.