public IActionResult StoreEmails(string storeId) { var store = HttpContext.GetStoreData(); if (store == null) { return(NotFound()); } var blob = store.GetStoreBlob(); var data = blob.EmailSettings; if (data?.IsComplete() is not true) { TempData.SetStatusMessageModel(new StatusMessageModel { Severity = StatusMessageModel.StatusSeverity.Warning, Html = $"You need to configure email settings before this feature works. <a class='alert-link' href='{Url.Action("StoreEmailSettings", new {storeId})}'>Configure now</a>." }); } var vm = new StoreEmailRuleViewModel { Rules = blob.EmailRules ?? new List <StoreEmailRule>() }; return(View(vm)); }
public async Task <IActionResult> StoreEmails(string storeId, StoreEmailRuleViewModel vm, string command) { vm.Rules ??= new List <StoreEmailRule>(); if (command.StartsWith("remove", StringComparison.InvariantCultureIgnoreCase)) { var item = command[(command.IndexOf(":", StringComparison.InvariantCultureIgnoreCase) + 1)..];