This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -16,16 +16,18 @@ namespace rockfishCore.Models
|
||||
|
||||
public partial class TrialRequest
|
||||
{
|
||||
public enum TrialRequestStatus{
|
||||
NotSet=0,
|
||||
Approved=1,
|
||||
Rejected=2
|
||||
public enum TrialRequestStatus
|
||||
{
|
||||
NotSet = 0,
|
||||
Approved = 1,
|
||||
Rejected = 2
|
||||
}
|
||||
public TrialRequest()
|
||||
{
|
||||
DtRequested=DateUtil.NowAsEpoch();
|
||||
EmailValidated=false;
|
||||
Status=TrialRequestStatus.NotSet;
|
||||
DtRequested = DateUtil.NowAsEpoch();
|
||||
EmailValidated = false;
|
||||
Status = TrialRequestStatus.NotSet;
|
||||
EmailConfirmCode = "?";
|
||||
}
|
||||
public long Id { get; set; }
|
||||
public Guid DbId { get; set; }
|
||||
@@ -33,7 +35,7 @@ namespace rockfishCore.Models
|
||||
public string ContactName { get; set; }
|
||||
public string Notes { get; set; }
|
||||
public string Email { get; set; }
|
||||
public string EmailConfirmCode {get;set;}
|
||||
public string EmailConfirmCode { get; set; }
|
||||
public bool EmailValidated { get; set; }
|
||||
public long? DtRequested { get; set; }
|
||||
public long? DtProcessed { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user