public void SendMail(string emailAddress) { var keys = new Majorsilence.Vpn.Logic.Accounts.BetaKeys(Majorsilence.Vpn.Logic.InitializeSettings.Email); keys.MailInvite(emailAddress); _emailSent = true; }
public ActionResult SendMail(string emailladdress) { if (sessionInstance.LoggedIn == false || sessionInstance.IsAdmin == false) { return(null); } var keys = new Majorsilence.Vpn.Logic.Accounts.BetaKeys(Majorsilence.Vpn.Logic.InitializeSettings.Email); keys.MailInvite(emailladdress, sessionInstance.UserId); return(View()); }
public void ValidDataTest() { var email = new Majorsilence.Vpn.Logic.Email.FakeEmail(); var test = new Majorsilence.Vpn.Logic.Accounts.BetaKeys(email); string betakey = test.MailInvite("*****@*****.**"); using (var cn = Majorsilence.Vpn.Logic.InitializeSettings.DbFactory) { cn.Open(); var data = cn.Query <Majorsilence.Vpn.Poco.BetaKeys>("SELECT * FROM BetaKeys WHERE Code=@Code", new { Code = betakey }); Assert.That(data.First().IsUsed, Is.False); Assert.That(data.First().IsSent, Is.True); } }