private async Task <EmailTemplate> GetTemplateOrFallbackToDefaultOrFailAsync(string codename, string culture)
        {
            var template = await _emailTemplateRepository.GetByCodenameAsync(codename, culture);

            if (template.HasValue)
            {
                return(template.Value);
            }

            template = await _emailTemplateRepository.GetByCodenameAsync(codename, _sendGridSettings.DefaultCulture);

            if (template.HasValue)
            {
                return(template.Value);
            }

            throw new ServiceException(OperationCodes.EmailTemplateNotFound,
                                       $"Email template: '{codename}' has not been found.");
        }