public void SendMail(string emailAddress) { var keys = new LibLogic.Accounts.BetaKeys(LibLogic.Setup.Email); keys.MailInvite(emailAddress); _emailSent = true; }
public ActionResult SendMail() { if (Helpers.SessionVariables.Instance.LoggedIn == false || Helpers.SessionVariables.Instance.IsAdmin == false) { return(null); } var emailAddress = VpnSite.Helpers.GlobalHelper.RequestParam("emailladdress").Trim(); var keys = new LibLogic.Accounts.BetaKeys(LibLogic.Setup.Email); keys.MailInvite(emailAddress, Helpers.SessionVariables.Instance.UserId); return(View()); }
public void ValidDataTest() { var email = new LibLogic.Email.FakeEmail(); var test = new LibLogic.Accounts.BetaKeys(email); string betakey = test.MailInvite("*****@*****.**"); using (var cn = LibLogic.Setup.DbFactory) { cn.Open(); var data = cn.Query <LibPoco.BetaKeys>("SELECT * FROM BetaKeys WHERE Code=@Code", new { Code = betakey }); Assert.That(data.First().IsUsed, Is.False); Assert.That(data.First().IsSent, Is.True); } }