Ejemplo n.º 1
0
        private static void AllertPersonToNewRound(PersonModel p, string teamName, MatchupEntryModel competitor)
        {
            if (p.EmailAddress.Length > 0)
            {
                string        to      = "";
                string        subject = "";
                StringBuilder body    = new StringBuilder();

                if (competitor != null)
                {
                    subject = $"You have a new matchup with { competitor.TeamCompeting.TeamName }.";

                    body.AppendLine("<h1>You have a new matchup</h1>");
                    body.Append("<strong>Competitor: </strong>");
                    body.Append(competitor.TeamCompeting.TeamName);
                    body.AppendLine();
                    body.AppendLine();
                    body.AppendLine("Have a great time!");
                    body.AppendLine("~ContestWinner Project");
                }
                else
                {
                    subject = "You have a bye week this round.";

                    body.AppendLine("Enjoy your round off!");
                    body.AppendLine("~ContestWinner Project");
                }

                to = p.EmailAddress;

                EmailLogic.SendEmail(to, subject, body.ToString());
            }

            try
            {
                if (p.CellPhoneNumber.Length > 0)
                {
                    if (competitor != null)
                    {
                        SMSLogic.SendSMSMessage(p.CellPhoneNumber, $"You have a new matchup with { competitor.TeamCompeting.TeamName }");
                    }
                    else
                    {
                        SMSLogic.SendSMSMessage(p.CellPhoneNumber, $"You have a bye week for the first round.");
                    }
                }
            }
            catch
            {
            }
        }
        private static void AlertPlayerToNewRound(PersonModel player, string teamName, MatchupEntryModel competingTeam)
        {
            if (player.EmailAddress.Length > 0)
            {
                string        to      = "";
                string        subject = "";
                StringBuilder body    = new StringBuilder();

                if (competingTeam != null)
                {
                    subject = $"You have a new game with { competingTeam.TeamCompeting.TeamName }!";
                    body.AppendLine("<h1>You have a new game ahead</h1>");
                    body.Append("<strong>Competitor: </strong>");
                    body.Append(competingTeam.TeamCompeting.TeamName);
                    body.AppendLine();
                    body.AppendLine();
                    body.AppendLine("Best of luck!");
                    body.AppendLine("~ Tournament Tracker");
                }
                else
                {
                    subject = "You have a bye week this round";
                    body.AppendLine("Rest up this week and prepare!");
                    body.AppendLine("~ Tournament Tracker");
                }

                to = player.EmailAddress;

                EmailLogic.SendEmail(to, subject, body.ToString());
            }

            if (player.CellPhoneNumber.Length > 0)
            {
                if (competingTeam != null)
                {
                    SMSLogic.SendSMSMessage(player.CellPhoneNumber, $"You have a new matchup with { competingTeam.TeamCompeting.TeamName }");
                }
                else
                {
                    SMSLogic.SendSMSMessage(player.CellPhoneNumber, "You have a bye week this round");
                }
            }
        }
Ejemplo n.º 3
0
        private static void AlertPersonToNewRound(PersonModel p, string teamName, MatchupEntryModel competitor)
        {
            if (p.EmailAddress.Length > 0)
            {
                string        to      = "";
                string        subject = "";
                StringBuilder body    = new StringBuilder();

                if (competitor != null)
                {
                    subject = $"You have a new matchup with { competitor.TeamCompeting.TeamName }";

                    body.AppendLine("<h1>You have a new matchup</h1>");
                    body.Append("<strong>Competitor: </strong>");
                    body.Append(competitor.TeamCompeting.TeamName);
                    body.AppendLine();
                    body.AppendLine();
                    body.AppendLine("Have a great time!");
                    body.AppendLine("~Tournament Tracker");
                }
                else
                {
                    subject = "You have a bye week this round";

                    body.AppendLine("Enjoy your round off!");
                    body.AppendLine("~Tournament Tracker");
                }

                to = p.EmailAddress;
                GlobalConfig.AppKeyLookup("senderEmail");

                EmailLogic.SendEmail(to, subject, body.ToString());
            }



            if (p.CellphoneNumber.Length > 0)
            {
                SMSLogic.SendSMSMessage(p.CellphoneNumber, $"You have a new matchup with { competitor.TeamCompeting.TeamName }");
            }
        }