Exemple #1
0
 public static EmailMessage Insert(string sender, string recipient, SchedulerMessage message)
 {
     return(new EmailMessage
     {
         SendingDate = DateTime.Now,
         SenderEmail = sender,
         RecipientEmail = recipient,
         Message = message
     });
 }
Exemple #2
0
        public static SchedulerItem Insert(string name, string messageSubject, string messageBody, ExecutionFrequency executionFrequency, int executionHours, int executionMinutes, DayOfWeek?executionDayOfWeek = null)
        {
            Validate(name);

            var schedulerMessage  = SchedulerMessage.Insert(messageSubject, messageBody);
            var schedulerSettings = SchedulerSettings.Insert(executionFrequency, executionHours, executionMinutes, executionDayOfWeek);

            return(new SchedulerItem
            {
                Name = name,
                IsActive = false,
                IsDeleted = false,
                Settings = schedulerSettings,
                Message = schedulerMessage
            });
        }