This commit is contained in:
2020-06-18 23:34:27 +00:00
parent 288720ce8b
commit 1e87f9b077
4 changed files with 31 additions and 12 deletions

View File

@@ -131,23 +131,26 @@ namespace rockfishCore.Controllers
DBLicense.Code = "na";
DBLicense.Key = Key;
DBLicense.RegTo = l.RegisteredTo;
DBLicense.DtLicenseExpiration=l.LicenseExpirationDate;
DBLicense.DtMaintenanceExpiration=l.MaintenanceExpirationDate;
DBLicense.DtLicenseExpiration = l.LicenseExpirationDate;
DBLicense.DtMaintenanceExpiration = l.MaintenanceExpirationDate;
await ct.License.AddAsync(DBLicense);
await ct.SaveChangesAsync();
//Key generated, record saved successfully
//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{newLicense}";
//send license email
//If key is not revoked (don't warn them in that case) send notification to customer
if (l.RegisteredTo != RavenKeyFactory.REVOKED_TOKEN)
{
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{newLicense}";
//send license email
#if (DEBUG)
RfMail.SendMessage("support@ayanova.com", "cardjohn@ayanova.com", "AyaNova license key", body, false);
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 Ok("ok");
}
catch (Exception ex)