private static MembershipRebootSetup CreateAdminInstance(IApplicationEnvironment appEnv, ILoggerFactory loggerFactory, EnvConfig config)
        {
            SecuritySettings      securitySettings = new SecuritySettings();
            MembershipRebootSetup newInstance      = GetDefaultConfigInstance(config.Uri.IssuerUri, securitySettings);
            AuthCentralAppInfo    appInfo          = BuildAppInfo(config.Uri.IssuerUri, config.AppName);

            var emailBodyType  = AuthCentralSmtpMessageDelivery.MsgBodyTypes.MultipartAlternativeAsJson;
            var emailFormatter = new AuthCentralEmailMessageFormatter(appEnv, appInfo, emailBodyType);

            emailFormatter.BodyTemplateNameResolverOverrides.Add(
                typeof(PasswordResetRequestedEvent <HierarchicalUserAccount>),
                (evt, extension) => "AccountCreatedAdminEvent_Body." + extension
                );

            emailFormatter.SubjectTemplateNameResolverOverrides.Add(
                typeof(PasswordResetRequestedEvent <HierarchicalUserAccount>),
                evt => "AccountCreatedEvent_Subject.txt"
                );

            var smtpMsgDelivery = new AuthCentralSmtpMessageDelivery(config, emailBodyType);

            newInstance.AddEventHandler(new DefaultEmailEventHandler(loggerFactory, emailFormatter, smtpMsgDelivery, newInstance));

            return(newInstance);
        }
        private static MembershipRebootSetup CreateDefaultInstance(IApplicationEnvironment appEnv, ILoggerFactory loggerFactory, EnvConfig config)
        {
            SecuritySettings      securitySettings = new SecuritySettings();
            MembershipRebootSetup newInstance      = GetDefaultConfigInstance(config.Uri.IssuerUri, securitySettings);
            AuthCentralAppInfo    appInfo          = BuildAppInfo(config.Uri.IssuerUri, config.AppName);

            var emailBodyType   = AuthCentralSmtpMessageDelivery.MsgBodyTypes.MultipartAlternativeAsJson;
            var emailFormatter  = new AuthCentralEmailMessageFormatter(appEnv, appInfo, emailBodyType);
            var smtpMsgDelivery = new AuthCentralSmtpMessageDelivery(config, emailBodyType);

            newInstance.AddEventHandler(new DefaultEmailEventHandler(loggerFactory, emailFormatter, smtpMsgDelivery, newInstance));
            newInstance.AddEventHandler(new UserEmailEventHandler(loggerFactory, emailFormatter, smtpMsgDelivery));

            return(newInstance);
        }