This commit is contained in:
@@ -134,7 +134,14 @@ namespace rockfishCore.Controllers
|
||||
//inform customer and return no content
|
||||
var body = $"Thank you for your purchase!\nYour AyaNova license key is ready to be installed.\nAyaNova will fetch it automatically within 24 hours or you can force it to fetch immediately from the License page in AyaNova now.\n---\n{l}";
|
||||
//send license email
|
||||
RfMail.SendMessage("support@ayanova.com", Customer.AdminEmail, "AyaNova license key", body, false);
|
||||
#if (DEBUG)
|
||||
RfMail.SendMessage("support@ayanova.com", "cardjohn@ayanova.com", "AyaNova license key", body, false);
|
||||
#else
|
||||
throw new System.Exception("UNCOMMENT THIS FOR PRODUCTION");
|
||||
// RfMail.SendMessage("support@ayanova.com", Customer.AdminEmail, "AyaNova license key", body, false);
|
||||
#endif
|
||||
|
||||
|
||||
return NoContent();
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@@ -102,15 +102,19 @@ namespace rockfishCore.Controllers
|
||||
}
|
||||
|
||||
//Get api/site/77/name
|
||||
[HttpGet("{id}/customerinfo")]
|
||||
public async Task<IActionResult> GetCustomerInfo([FromRoute] long id)
|
||||
[HttpGet("{id}/newlicenseinfo")]
|
||||
public async Task<IActionResult> GetNewLicenseInfo([FromRoute] long id)
|
||||
{
|
||||
if (!ModelState.IsValid)
|
||||
{
|
||||
return BadRequest(ModelState);
|
||||
}
|
||||
var custId = await ct.Site.AsNoTracking().Where(z => z.Id == id).Select(z => z.CustomerId).FirstAsync();
|
||||
var custInfo = await ct.Customer.AsNoTracking().Where(z => z.Id == custId).Select(z => new { z.Name, z.Id }).SingleAsync();
|
||||
var site = await ct.Site.AsNoTracking().Where(z => z.Id == id).FirstOrDefaultAsync();
|
||||
if (site == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
var custInfo = await ct.Customer.AsNoTracking().Where(z => z.Id == site.CustomerId).Select(z => new { z.Name, z.Id, dbid = site.DbId }).SingleAsync();
|
||||
return Ok(custInfo);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user