private IEnumerable <MessageOutbound> generateMessages(ScheduleItemSmall post, ScheduleItemComment comment) { IEnumerable <ScheduleItemSubscription> subscriptions = scheduleItemRepository.GetSubscriptions(post.EventName, post.Slug); List <MessageOutbound> messages = new List <MessageOutbound>(); //TODO: (erikpo) Once the plugin model is done, get this from the plugin int retryCount = 4; foreach (ScheduleItemSubscription subscription in subscriptions) { string userName = subscription.UserName; MessageOutbound message = new MessageOutbound { ID = Guid.NewGuid(), To = !string.IsNullOrEmpty(userName) ? string.Format("{0} <{1}>", userName, subscription.UserEmail) : subscription.UserEmail, Subject = string.Format(getPhrase("Messages.Formats.ReplySubject", context.Site.LanguageDefault, "RE: {0}"), post.Title), Body = generateMessageBody(post, comment, context.Site), RemainingRetryCount = retryCount }; messages.Add(message); } return(messages); }