public async Task <bool> SendNotiAsync(Notification notification, SpecificGame game) { try { using (MailMessage mail = new MailMessage()) { mail.Subject = $"{game.info.title} PRICE ALERT"; mail.Body = $"<!DOCTYPE html>" + $"<html>" + $"<body>" + $"<h1>Price Alert!!!!</h1>" + $"<div>" + $"<h3>Hi {notification.name},</h3>" + $"<h3>{game.info.title} is selling for <span style = 'color:red'>${game.deals[0].price}</span> on <a href = '{REDIRECT_URL + game.deals[0].dealID}' style=''>{game.deals[0].store}</a></h3>" + $"</div>" + $"</body>" + $"</html>"; mail.IsBodyHtml = true; mail.From = new MailAddress(_options.Value.Emailkeys.Username); mail.To.Add(new MailAddress(notification.email)); await SendMailAsync(mail); } return(true); } catch (Exception ex) { return(false); } }
public bool GameOver() { return((!GameFull && currentState == State.Started) || SpecificGame.HasWinner() || SpecificGame.IsBoardFull()); }