Can clear email settings Fix #150

This commit is contained in:
nicolas.dorier
2018-05-04 02:16:12 +09:00
parent 3ab69046b0
commit 8f1324fdf3
2 changed files with 8 additions and 1 deletions

View File

@@ -255,7 +255,7 @@ namespace BTCPayServer.Controllers
}
return View(model);
}
else
else if(command == "Save")
{
ModelState.Remove(nameof(model.TestEmail));
if (!ModelState.IsValid)
@@ -264,6 +264,12 @@ namespace BTCPayServer.Controllers
model.StatusMessage = "Email settings saved";
return View(model);
}
else
{
await _SettingsRepository.UpdateSetting(new EmailSettings());
model.StatusMessage = "Email settings cleared";
return View(model);
}
}
}
}

View File

@@ -57,6 +57,7 @@
<button type="submit" class="btn btn-primary" name="command" value="Save">Save</button>
<button type="submit" class="btn btn-primary" name="command" value="Test">Test</button>
<button type="submit" class="btn btn-danger" name="command" value="Clear">Clear</button>
</form>
</div>
</div>