SMS-utskick har lagts till
This commit is contained in:
@ -73,38 +73,43 @@ namespace TrackerLibrary
|
||||
|
||||
private static void AlertPersonToNewRound(PersonModel p, string teamName, MatchupEntryModel competitor)
|
||||
{
|
||||
if (p.EmailAddress.Length == 0)
|
||||
if (p.EmailAddress.Length > 0)
|
||||
{
|
||||
return;
|
||||
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");
|
||||
}
|
||||
|
||||
string to = p.EmailAddress;
|
||||
|
||||
|
||||
EmailLogic.SendEmail(to, subject, body.ToString());
|
||||
}
|
||||
|
||||
string subject;
|
||||
StringBuilder body = new StringBuilder();
|
||||
|
||||
if (competitor != null)
|
||||
|
||||
if (p.CellPhoneNumber.Length > 0)
|
||||
{
|
||||
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");
|
||||
SMSLogic.SendSMSMessage(p.CellPhoneNumber, $"You have a new matchup with {competitor.TeamCompeting.TeamName}");
|
||||
}
|
||||
else
|
||||
{
|
||||
subject = "You have a bye week this round";
|
||||
|
||||
body.AppendLine("Enjoy your round off!");
|
||||
body.AppendLine("~Tournament Tracker");
|
||||
}
|
||||
|
||||
string to = p.EmailAddress;
|
||||
|
||||
|
||||
EmailLogic.SendEmail(to, subject, body.ToString()); ;
|
||||
}
|
||||
|
||||
private static int CheckCurrentRound(this TournamentModel model)
|
||||
|
||||
Reference in New Issue
Block a user