예제 #1
0
        private async Task <string> BuildMessageBody(Config.EmailMessageConfig greetingEmailConfig, EnrollmentAggregate aggregate)
        {
            var body = await greetingEmailConfig.BuildMessageBody();

            var model = new { aggregate.FirstName, aggregate.LastName, aggregate.FullName, aggregate.Email, aggregate.PhoneNumber, aggregate.Region };

            return(_fluidTemplateRenderer.Render(body, model));
        }
        private async Task <string> BuildMessageBody(Config.EmailMessageConfig emailConfig, EnrollmentAggregate aggregate, Entities.Training training)
        {
            var body = await emailConfig.BuildMessageBody();

            var model = new {
                Candidate = new { aggregate.FirstName, aggregate.LastName, aggregate.FullName, aggregate.Email, aggregate.PhoneNumber, aggregate.Region },
                Training  = new {
                    training.Address, training.City, training.StartDateTime, training.EndDateTime,
                    StartDate = training.StartDateTime.Date, StartTime = training.StartDateTime.TimeOfDay,
                    EndDate   = training.EndDateTime.Date, EndTime = training.EndDateTime.TimeOfDay,
                    Duration  = training.Duration.ToString("HH':'mm", null)
                }
            };

            return(_fluidTemplateRenderer.Render(body, model));
        }