diff --git a/BTCPayServer.Tests/SeleniumTests.cs b/BTCPayServer.Tests/SeleniumTests.cs
index 6bec76f44..f1ebb2f1a 100644
--- a/BTCPayServer.Tests/SeleniumTests.cs
+++ b/BTCPayServer.Tests/SeleniumTests.cs
@@ -828,14 +828,16 @@ namespace BTCPayServer.Tests
Assert.DoesNotContain("You need to configure email settings before this feature works", s.Driver.PageSource);
s.Driver.FindElement(By.Id("CreateEmailRule")).Click();
- var select = new SelectElement(s.Driver.FindElement(By.Id("Rules_0__Trigger")));
+ var select = new SelectElement(s.Driver.FindElement(By.Id("Trigger")));
select.SelectByText("An invoice has been settled", true);
- s.Driver.FindElement(By.Id("Rules_0__To")).SendKeys("test@gmail.com");
- s.Driver.FindElement(By.Id("Rules_0__CustomerEmail")).Click();
- s.Driver.FindElement(By.Id("Rules_0__Subject")).SendKeys("Thanks!");
+ s.Driver.FindElement(By.Id("To")).SendKeys("test@gmail.com");
+ s.Driver.FindElement(By.Id("CustomerEmail")).Click();
+ s.Driver.FindElement(By.Id("Subject")).SendKeys("Thanks!");
s.Driver.FindElement(By.ClassName("note-editable")).SendKeys("Your invoice is settled");
s.Driver.FindElement(By.Id("SaveEmailRules")).Click();
- Assert.Contains("Store email rules saved", s.FindAlertMessage().Text);
+ // we now have a rule
+ Assert.DoesNotContain("There are no rules yet.", s.Driver.PageSource);
+ Assert.Contains("test@gmail.com", s.Driver.PageSource);
s.GoToStore(StoreNavPages.Emails);
Assert.True(s.Driver.FindElement(By.Id("IsCustomSMTP")).Selected);
diff --git a/BTCPayServer/Controllers/UIStoresController.EmailRules.cs b/BTCPayServer/Controllers/UIStoresController.EmailRules.cs
index 9aabb999f..369d67e5f 100644
--- a/BTCPayServer/Controllers/UIStoresController.EmailRules.cs
+++ b/BTCPayServer/Controllers/UIStoresController.EmailRules.cs
@@ -4,6 +4,8 @@ using System.ComponentModel.DataAnnotations;
using System.Globalization;
using System.Linq;
using System.Threading.Tasks;
+using BTCPayServer.Abstractions.Extensions;
+using BTCPayServer.Abstractions.Models;
using BTCPayServer.Client;
using BTCPayServer.Data;
using BTCPayServer.Models;
@@ -18,10 +20,21 @@ namespace BTCPayServer.Controllers
public partial class UIStoresController
{
[HttpGet("{storeId}/emails/rules")]
- public IActionResult EmailRulesIndex(string storeId)
+ public async Task@ViewData["Title"]
-
Create Email Rule
@@ -28,34 +28,43 @@
Email rules allow BTCPay Server to send customized emails from your store based on events.
| Trigger | -Customer Email | -To | -Subject | -Actions | -
|---|---|---|---|---|
| @rule.value.Trigger | -@(rule.value.CustomerEmail ? "Yes" : "No") | -@rule.value.To | -@rule.value.Subject | -- Edit - - - - | -
| Trigger | +Customer Email | +To | +Subject | +Actions | +
|---|---|---|---|---|
| @rule.value.Trigger | +@(rule.value.CustomerEmail ? "Yes" : "No") | +@rule.value.To | +@rule.value.Subject | ++ Edit + - + + | +
+ There are no rules yet. +
+} diff --git a/BTCPayServer/Views/UIStores/StoreEmailRulesManage.cshtml b/BTCPayServer/Views/UIStores/StoreEmailRulesManage.cshtml index f30212f78..5126378ab 100644 --- a/BTCPayServer/Views/UIStores/StoreEmailRulesManage.cshtml +++ b/BTCPayServer/Views/UIStores/StoreEmailRulesManage.cshtml @@ -17,7 +17,7 @@