This commit is contained in:
2020-06-12 19:45:53 +00:00
parent f66096e875
commit 490423a708
2 changed files with 17 additions and 12 deletions

View File

@@ -38,8 +38,10 @@ namespace rockfishCore.Controllers
#if (DEBUG)
private const string LICENSE_SERVER_URL = "http://localhost:3001/";
private const string SUPPORT_EMAIL = "cardjohn@ayanova.com";
#else
private const string LICENSE_SERVER_URL = "https://rockfish.ayanova.com/";
private const string SUPPORT_EMAIL="support@ayanova.com";
#endif
[HttpPost]
@@ -80,15 +82,16 @@ namespace rockfishCore.Controllers
await ct.SaveChangesAsync();
NewRequest.EmailConfirmCode = NewRequest.Id.ToString() + FetchKeyCode.generate();
await ct.SaveChangesAsync();
var verifyUrl = LICENSE_SERVER_URL + $"rvr/verify?code={NewRequest.EmailConfirmCode}";
var verifyUrl = LICENSE_SERVER_URL + $"rvr/verify/{NewRequest.EmailConfirmCode}";
var body = $"Please verify your email address by clicking the link below or copy and pasting into a browser\r\n{verifyUrl}\r\n(If you did not request this you can ignore this message)";
//send confirmation email
RfMail.SendMessage("support@ayanova.com", NewRequest.Email, "AyaNova trial request email verification", body, false);
return Ok(new { Accepted = true });
//return Ok(new { Accepted = true });
return Accepted();
}
[HttpGet("verify")]
[HttpGet("verify/{code}")]
public async Task<IActionResult> GetVerify([FromRoute] string code)
{
//is there a valid trial request
@@ -108,7 +111,7 @@ namespace rockfishCore.Controllers
//notify *us*
//http://localhost:3001/default.htm#!/trials/[id]
var rfUrl = LICENSE_SERVER_URL + $"default.htm#!/trials/{req.Id}";
var rfUrl = LICENSE_SERVER_URL + $"default.htm#!/trialEdit/{req.Id}";
var body = $"Email address {req.Email} was just verified for {req.ContactName} at {req.CompanyName}.\r\nTrial key is ready to be processed now:\r\n{rfUrl}";
//send confirmation email
RfMail.SendMessage("support@ayanova.com", "support@ayanova.com", "AyaNova trial request requiring action", body, false);