diff --git a/src/ContactForm/Function.cs b/src/ContactForm/Function.cs index 9973f18..b432cb7 100644 --- a/src/ContactForm/Function.cs +++ b/src/ContactForm/Function.cs @@ -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) diff --git a/src/ContactForm/Settings/AppSettings.cs b/src/ContactForm/Settings/AppSettings.cs index acdd067..7cfbae4 100644 --- a/src/ContactForm/Settings/AppSettings.cs +++ b/src/ContactForm/Settings/AppSettings.cs @@ -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; } diff --git a/src/ContactForm/appsettings.json b/src/ContactForm/appsettings.json index 74683b1..aecf99b 100644 --- a/src/ContactForm/appsettings.json +++ b/src/ContactForm/appsettings.json @@ -1,5 +1,6 @@ { "App": { + "ReturnUrl": "http://www.example.com", "EmailFrom": "sender@example.com", "EmailTo": "hello@example.com", "Host": "smtp.example.com", diff --git a/test/ContactForm.Tests/appsettings.json b/test/ContactForm.Tests/appsettings.json index 7a7dc0c..830c83f 100644 --- a/test/ContactForm.Tests/appsettings.json +++ b/test/ContactForm.Tests/appsettings.json @@ -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"],