示例#1
0
        private static void CreateTextTemplates(IEntitySession session)
        {
            //Password reset
              session.NewTextTemplate(LoginMessageTemplates.PasswordResetPinEmailSubject,
            "BookStore password reset pin", TemplateFormat.Text);
              session.NewTextTemplate(LoginMessageTemplates.PasswordResetPinEmailBody,
            @"Dear BookStore customer <#UserName#>,
            This is a pin for a password reset process recently started on our site: <#Pin#>
            Use this pin on our site to continue the process.", TemplateFormat.Text);
              session.NewTextTemplate(LoginMessageTemplates.PasswordResetPinSmsBody,
            "Pin: <#Pin#>", TemplateFormat.Text);
              session.NewTextTemplate(LoginMessageTemplates.PasswordResetCompleteEmailSubject,
            "BookStore password changed", TemplateFormat.Text);
              session.NewTextTemplate(LoginMessageTemplates.PasswordResetCompleteEmailBody,
            @"Dear BookStore customer <#UserName#>,
            This is a notification that your password on our site had been changed.", TemplateFormat.Text);
              //Verification
              session.NewTextTemplate(LoginMessageTemplates.VerifyEmailSubject,
            "BookStore email verification", TemplateFormat.Text);
              session.NewTextTemplate(LoginMessageTemplates.VerifyEmailBody,
            @"Dear BookStore customer <#UserName#>,
            This is a pin for email verification: <#Pin#>
            Use this pin on our site to confirm the ownership of email account.", TemplateFormat.Text);
              session.NewTextTemplate(LoginMessageTemplates.VerifySmsBody, "Pin: <#Pin#>", TemplateFormat.Text);

              //multi-factor login
              session.NewTextTemplate(LoginMessageTemplates.MultiFactorEmailSubject,
            "BookStore login process", TemplateFormat.Text);
              session.NewTextTemplate(LoginMessageTemplates.MultiFactorEmailBody,
            @"Dear BookStore customer <#UserName#>,
            This is a pin for multi-factor login: <#Pin#>
            Use this pin on our site to complete the login process.", TemplateFormat.Text);
              session.NewTextTemplate(LoginMessageTemplates.MultiFactorSmsBody,
            "Pin: <#Pin#>", TemplateFormat.Text);
              session.NewTextTemplate(LoginMessageTemplates.OneTimePasswordSubject,
            "You BookStore password", TemplateFormat.Text);
              session.NewTextTemplate(LoginMessageTemplates.OneTimePasswordBody,
            @"Dear BookStore customer <#UserName#>,
            Site administrator has set a temporary password for your account: <#Password#>
            Use this password to login to your account. Note that this is one-time password.", TemplateFormat.Text);
        }