-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
gauffininteractive
committed
Feb 16, 2017
1 parent
02e928b
commit 3f53e08
Showing
20 changed files
with
219 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
src/Server/OneTrueError.App/Core/Support/SendSupportRequestHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
using System.Collections.Generic; | ||
using System.Net.Http; | ||
using System.Threading.Tasks; | ||
using DotNetCqs; | ||
using Griffin.Container; | ||
using OneTrueError.Api.Core.Support; | ||
using OneTrueError.App.Configuration; | ||
using OneTrueError.Infrastructure.Configuration; | ||
|
||
namespace OneTrueError.App.Core.Support | ||
{ | ||
/// <summary> | ||
/// Sends a support request to the OneTrueError Team. | ||
/// </summary> | ||
/// <remarks> | ||
/// <para> | ||
/// You must have bought commercial support or registered to get 30 days of free support. | ||
/// </para> | ||
/// </remarks> | ||
[Component] | ||
public class SendSupportRequestHandler : ICommandHandler<SendSupportRequest> | ||
{ | ||
/// <inheritdoc /> | ||
public async Task ExecuteAsync(SendSupportRequest command) | ||
{ | ||
var baseConfig = ConfigurationStore.Instance.Load<BaseConfiguration>(); | ||
var errorConfig = ConfigurationStore.Instance.Load<OneTrueErrorConfigSection>(); | ||
|
||
string installationId = null; | ||
var email = baseConfig.SupportEmail; | ||
if (errorConfig != null) | ||
{ | ||
email = errorConfig.ContactEmail; | ||
installationId = errorConfig.InstallationId; | ||
} | ||
|
||
|
||
var items = new List<KeyValuePair<string, string>>(); | ||
if (installationId != null) | ||
items.Add(new KeyValuePair<string, string>("InstallationId", installationId)); | ||
items.Add(new KeyValuePair<string, string>("ContactEmail", email)); | ||
items.Add(new KeyValuePair<string, string>("Subject", command.Subject)); | ||
items.Add(new KeyValuePair<string, string>("Message", command.Message)); | ||
|
||
//To know which page the user had trouble with | ||
items.Add(new KeyValuePair<string, string>("PageUrl", command.Url)); | ||
|
||
var content = new FormUrlEncodedContent(items); | ||
var client = new HttpClient(); | ||
await client.PostAsync("https://onetrueerror.com/support/request", content); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/Server/OneTrueError.Web/Areas/Installation/Models/SupportViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using System.ComponentModel.DataAnnotations; | ||
|
||
namespace OneTrueError.Web.Areas.Installation.Models | ||
{ | ||
public class SupportViewModel | ||
{ | ||
[EmailAddress] | ||
public string Email { get; set; } | ||
|
||
public string CompanyName { get; set; } | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
src/Server/OneTrueError.Web/Areas/Installation/Views/Setup/Support.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
@model OneTrueError.Web.Areas.Installation.Models.SupportViewModel | ||
@{ | ||
ViewBag.Title = "Installation - Support"; | ||
} | ||
<div class="container"> | ||
<div class="col-lg-6"> | ||
|
||
<h2>Free Support</h2> | ||
<p>Do you want to get 30 days of free email support?</p> | ||
<p>No obligations attached, but you can purchase commercial support after that if you would like to support the project.</p> | ||
<form method="post" action="@Url.Action("Support")" style="width: 100%" class="form"> | ||
@Html.ValidationSummary(false) | ||
<div> | ||
<input type="text" | ||
name="CompanyName" class="form-control" value="@Model.CompanyName" placeholder="Company name" /> | ||
|
||
<input type="email" | ||
name="Email" class="form-control" value="@Model.Email" placeholder="Your email address" /> | ||
</div> | ||
<div><em>(Leave fields empty if you do not want to sign up)</em></div> | ||
<div> </div> | ||
<br /> | ||
@Html.Raw(ViewBag.PrevLink) | ||
<input type="submit" class="btn btn-primary" value="Signup" /> | ||
@Html.Raw(ViewBag.NextLink) | ||
</form> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/Server/OneTrueError.Web/ViewModels/Application/DetailsViewModel.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.