public async Task <string> ReadTemplateAsync(string templateName)
        {
            var templatePath = pathManager.GetEmailTemplatePath(templateName);

            if (!File.Exists(templatePath))
            {
                throw new StreetwoodException(ErrorCode.EmailTemplateNotExists(templateName));
            }

            var emailTemplate = await File.ReadAllTextAsync(templatePath);

            return(emailTemplate);
        }
Пример #2
0
        public async Task <string> ReadTemplateAsync(string templateName)
        {
            var templatePath = pathManager.GetEmailTemplatePath(templateName);

            if (!File.Exists(templatePath))
            {
                throw new SalonException(ErrorCode.EmailTemplateNotExists(templateName));
            }

            var emailTemplate = await File.ReadAllTextAsync(templatePath);

            if (string.IsNullOrEmpty(emailTemplate))
            {
                throw new Exception($"Cannot read email template from path: '{templateName}'.");
            }

            return(emailTemplate);
        }