private static void AlertPersonToNewRound(PersonModel p, string teamName, MatchUpEntryModel competitor) { if (string.IsNullOrWhiteSpace(p.EmailAddress)) { return; } 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 week off."); body.AppendLine("~Tournament Tracker"); } to = p.EmailAddress; EmalLogic.SendEmail(to, subject, body.ToString()); }
private static void AlertPersonToNewRound(PersonModel p, string teamName, MatchUpEntryModel competitor) { if (p.EmailAddress == null) { return; } if (p.EmailAddress.Length == 0) { return; } string toAdress = ""; 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</h>"); body.Append("<strong>Competetitor:<strong> "); body.Append(competitor.TeamCompeting.TeamName); body.AppendLine(); body.AppendLine(); body.AppendLine("have a great time!"); body.AppendLine("tournamet tracker"); } else { subject = "you have a bye week this round"; body.AppendLine("injoy your round off"); body.AppendLine("tournamet tracker"); } toAdress = p.EmailAddress; EmailLogic.SendEmail(toAdress, subject, body.ToString()); }