Ejemplo n.º 1
0
        public void SendReminder(ReminderTask reminder)
        {
            Logger.LogInfo( string.Format( @"Sending remindii
                                             Address: {0}
                                             Name:    {1},
                                             Date:    {2},", reminder.EmailAddress,
                                                     reminder.Name.Encode(),
                                                     reminder.Date.ToShortDateString() ) );
              //generate subject
              string subject = string.Format( "Remindii For: {0} on {1}"
              , reminder.Name
              , string.Format( "{0:D}", reminder.Date ) );

              //generate body
              string body = string.Format( @"
            <p>To delete this remindii immediately click this deletion link: http://remindii.com/delete/{0}</p>
            See you on http://remindii.com !"
              , reminder.ID );

              SendEmail( reminder.EmailAddress, body, subject );
        }
Ejemplo n.º 2
0
        public void SendReminderTest()
        {
            ReminderTask reminder = new ReminderTask()
              {
            Date = DateTime.Now,
            EmailAddress = "*****@*****.**",
            ID = Guid.NewGuid(),
            Name = "Test Bday"
              };

              MailMessageService messageService = new MailMessageService(_logger);
              messageService.SendReminder( reminder );
        }
Ejemplo n.º 3
0
        internal ReminderTask GetNextTimeHasComeReminder()
        {
            ReminderTask reminder = null;
              try
              {
            var sqlCom = _db.GetReadCommand( @"SELECT
                                     ReminderID, Name, e.EmailAddress, Day, Month
                                    FROM reminder r

                                    INNER JOIN email e
                                        ON e.EmailID = r.EmailID

                                    WHERE
                                        (`NextRemindingDate` < Now())
                                    AND
                                        (e.EmailVerificationID IS Null)
                                    LIMIT 1;" );
            using (var rdr = sqlCom.ExecuteReader())
            {
              while (rdr.Read())
              {
            var date = new DateTime( DateTime.Now.Year
                                    , rdr.GetInt32( "Month" )
                                    , rdr.GetInt32( "Day" ) );
            reminder = new ReminderTask()
            {
              EmailAddress = rdr.GetString( "EmailAddress" ),
              ID = rdr.GetGuid( "ReminderID" ),
              Name = rdr.GetString( "Name" ),
              Date = date
            };
              }
            }
            return reminder;
              }
              finally
              {
            _db.CloseConnections();
              }
        }
Ejemplo n.º 4
0
 public void SendReminder(ReminderTask reminder)
 {
     this.SentoutReminder = reminder;
     this.ReminderEmailsSentCount++;
 }