Added configurable return url

This commit is contained in:
Alex Hyett 2018-12-12 13:51:17 +00:00
parent 779bad518b
commit 79b735f507
4 changed files with 10 additions and 2 deletions

View file

@ -77,7 +77,7 @@ namespace ContactForm
}
Log.CloseAndFlush();
return new { location = "https://www.alexhyett.com" };
return new { location = _appSettings.ReturnUrl };
}
private void ConfigureServices(IServiceCollection serviceCollection)

View file

@ -2,6 +2,7 @@ namespace ContactForm
{
public class AppSettings
{
public string ReturnUrl { get; set; }
public string EmailFrom { get; set; }
public string EmailTo { get; set; }
public string Host { get; set; }

View file

@ -1,5 +1,6 @@
{
"App": {
"ReturnUrl": "http://www.example.com",
"EmailFrom": "sender@example.com",
"EmailTo": "hello@example.com",
"Host": "smtp.example.com",

View file

@ -1,6 +1,12 @@
{
"App": {
"Prefix": "Test"
"ReturnUrl": "http://www.example.com",
"EmailFrom": "sender@example.com",
"EmailTo": "hello@example.com",
"Host": "smtp.example.com",
"Port": 465,
"Username": "email-username",
"Password": "email-password"
},
"Serilog": {
"Using": ["Serilog.Sinks.Seq"],