public void SendCompletedGuessResultToContestCreator(Profile profile, Prediction prediction)
        {
            try
            {
                StringBuilder sb = new StringBuilder();

                sb.AppendFormat("<table>");
                sb.AppendFormat("<tr><th>Field</th><th>Value</th></tr>");
                sb.AppendFormat("<tr><th>{0}</th><td>{1}</td></tr>", "Name", profile.Name);
                sb.AppendFormat("<tr><th>{0}</th><td>{1}</td></tr>", "Email", profile.EmailAddress);
                sb.AppendFormat("<tr><th>{0}</th><td>{1}</td></tr>", "Gender", prediction.Gender);
                sb.AppendFormat("<tr><th>{0}</th><td>{1}</td></tr>", "Date", ((DateTime)prediction.Date).ToString("MM/dd/yyyy"));
                sb.AppendFormat("<tr><th>{0}</th><td>{1}</td></tr>", "Time", ((DateTime)prediction.Time).ToString("hh:mm"));
                sb.AppendFormat("<tr><th>{0}</th><td>{1} lbs</td></tr>", "Weight", prediction.Weight);
                sb.AppendFormat("<tr><th>{0}</th><td>{1} in</td></tr>", "Length", prediction.Length);
                sb.AppendFormat("<tr><th>{0}</th><td>{1}</td></tr>", "Message", prediction.Message);
                sb.AppendFormat("</table>");
                //sb.AppendFormat("Thanks for signing up to make guesses. To keep things simple, you don't need a username or password, just an email account. We've included this link: {0} that you can use to make guesses or check on the statistics of other guessers. If you lose this email and need access again just enter your email address in again.", "");

                SendNotification(dueDateCreatorEmailAddress, string.Format("Baby Peters - {0} Made a Guess!", profile.Name), sb.ToString());
            }
            catch (Exception ex)
            {
                logger.Error("Error sending notification.", ex);
            }
        }
        public void SendAuth(Profile profile, DueDate dueDate)
        {
            StringBuilder sb = new StringBuilder();

            //sb.AppendFormat("Dear {0},<br /><br />\n", profile.Name ?? "Friend");
            sb.AppendFormat("<p>Kim and Joey are expecting a baby soon. They have invited you to take part in a game to predict when Baby P will be born.</p>");
            sb.AppendFormat("<p>Use the link below to make your prediction or view the results as people continue to vote.</p>");

            string link = string.Format("{0}invitation?code={1}", settings.ApplicationUrl, profile.EmailCode);

            sb.AppendFormat("<p><a href=\"{0}\">{0}</a></p>", link);
            //sb.AppendFormat("<p><a href=\"{0}#/results/start?code={1}\">View Results</a></p>", baseUri, profile.EmailCode);
            //sb.AppendFormat("Thanks for signing up to make guesses. To keep things simple, you don't need a username or password, just an email account. We've included this link: {0} that you can use to make guesses or check on the statistics of other guessers. If you lose this email and need access again just enter your email address in again.", "");

            SendNotification(profile.EmailAddress, "Baby Peters - Make Your Prediction", sb.ToString());
        }
示例#3
0
 public ProfilePrediction(Profile profile, Prediction prediction, PredictionScore predictionScore = null)
 {
     this.Profile = profile;
     this.Prediction = prediction;
     this.PredictionScore = predictionScore;
 }
示例#4
0
 public ProfilePrediction(Profile profile)
 {
     this.Profile = profile;
     this.Prediction = null;
 }
        public void SendInvitation(Profile profile, DueDate dueDate)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("Dear {0},<br /><br />\n", profile.Name ?? "Friend");
            sb.AppendFormat("<a href=\"{0}#/invite?code={1}\">Make Prediction</a>", settings.ApplicationUrl, profile.EmailCode);
            //sb.AppendFormat("Thanks for signing up to make guesses. To keep things simple, you don't need a username or password, just an email account. We've included this link: {0} that you can use to make guesses or check on the statistics of other guessers. If you lose this email and need access again just enter your email address in again.", "");

            SendNotification(dueDateCreatorEmailAddress, "Baby Peters - You are invited to make a prediction", sb.ToString());
        }