private List <MailContentTemplate> AddMailTemplate(IPlatformDataSource source, Guid adminId, Guid mainGroupId, string directory, EntityType mailTemplateType, DateTime date, string[] supportedCultures)
        {
            // Add the mail template
            var templateName = "Default";
            var templateData = this._fileSystemWrapper.GetHtmlTemplate(directory, "MailTemplate", null);
            List <MailContentTemplate> templateContent = new List <MailContentTemplate>();

            var templateEntity = new PlatformEntity
            {
                Id          = Guid.NewGuid(),
                GroupId     = mainGroupId,
                Url         = templateName.ToLower(),
                EntityType  = mailTemplateType,
                OwnerUserId = adminId
            };

            source.Save(templateEntity);

            foreach (var data in templateData.Where(t => supportedCultures.Contains(t.Culture.ToLower())))
            {
                var template = new MailContentTemplate
                {
                    Id                = Guid.NewGuid(),
                    EntityId          = templateEntity.Id,
                    Entity            = templateEntity,
                    Culture           = data.Culture,
                    VersionNumber     = 1,
                    Name              = "Default",
                    CreatedByUserId   = adminId,
                    CreatedOn         = date,
                    UpdatedByUserId   = adminId,
                    UpdatedOn         = date,
                    IsCurrentVersion  = true,
                    PublishedByUserId = adminId,
                    PublishedOn       = date,
                    Body              = data.Body
                };

                templateContent.Add(template);
                source.Save(template);
            }

            return(templateContent);
        }
        private List<MailContentTemplate> AddMailTemplate(IPlatformDataSource source, Guid adminId, Guid mainGroupId, string directory, EntityType mailTemplateType, DateTime date, string[] supportedCultures)
        {
            // Add the mail template
            var templateName = "Default";
            var templateData = this._fileSystemWrapper.GetHtmlTemplate(directory, "MailTemplate", null);
            List<MailContentTemplate> templateContent = new List<MailContentTemplate>();

            var templateEntity = new PlatformEntity
            {
                Id = Guid.NewGuid(),
                GroupId = mainGroupId,
                Url = templateName.ToLower(),
                EntityType = mailTemplateType,
                OwnerUserId = adminId
            };

            source.Save(templateEntity);

            foreach (var data in templateData.Where(t => supportedCultures.Contains(t.Culture.ToLower())))
            {
                var template = new MailContentTemplate
                {
                    Id = Guid.NewGuid(),
                    EntityId = templateEntity.Id,
                    Entity = templateEntity,
                    Culture = data.Culture,
                    VersionNumber = 1,
                    Name = "Default",
                    CreatedByUserId = adminId,
                    CreatedOn = date,
                    UpdatedByUserId = adminId,
                    UpdatedOn = date,
                    IsCurrentVersion = true,
                    PublishedByUserId = adminId,
                    PublishedOn = date,
                    Body = data.Body
                };

                templateContent.Add(template);
                source.Save(template);
            }

            return templateContent;
        }