public virtual string Tokenize(
                UserAccountEvent <TAccount> accountEvent,
                ApplicationInformation appInfo,
                string msg,
                IDictionary <string, string> values)
            {
                var user = accountEvent.Account;

                msg = msg.Replace("{username}", user.Username);
                msg = msg.Replace("{email}", user.Email);
                msg = msg.Replace("{mobile}", user.MobilePhoneNumber);

                msg = msg.Replace("{applicationName}", appInfo.ApplicationName);
                msg = msg.Replace("{emailSignature}", appInfo.EmailSignature);
                msg = msg.Replace("{loginUrl}", appInfo.LoginUrl);

                if (values.ContainsKey("VerificationKey"))
                {
                    msg = msg.Replace("{confirmPasswordResetUrl}", appInfo.ConfirmPasswordResetUrl + values["VerificationKey"]);
                    msg = msg.Replace("{confirmChangeEmailUrl}", appInfo.ConfirmChangeEmailUrl + values["VerificationKey"]);
                    msg = msg.Replace("{cancelVerificationUrl}", appInfo.CancelVerificationUrl + values["VerificationKey"]);
                }

                foreach (var item in values)
                {
                    msg = msg.Replace("{" + item.Key + "}", item.Value);
                }

                return(msg);
            }
 public override string Tokenize(UserAccountEvent accountEvent, ApplicationInformation appInfo, string msg)
 {
     var evt = (LinkedAccountAddedEvent)accountEvent;
     msg = base.Tokenize(accountEvent, appInfo, msg);
     msg = msg.Replace("{provider}", evt.LinkedAccount.ProviderName);
     return msg;
 }
示例#3
0
            public override string Tokenize(UserAccountEvent accountEvent, ApplicationInformation appInfo, string msg)
            {
                var evt = (LinkedAccountRemovedEvent)accountEvent;

                msg = base.Tokenize(accountEvent, appInfo, msg);
                msg = msg.Replace("{provider}", evt.LinkedAccount.ProviderName);
                return(msg);
            }
 public override string Tokenize(UserAccountEvent accountEvent, ApplicationInformation appInfo, string msg)
 {
     var evt = (EmailChangedEvent)accountEvent;
     msg = base.Tokenize(accountEvent, appInfo, msg);
     msg = msg.Replace("{newEmail}", accountEvent.Account.Email);
     msg = msg.Replace("{oldEmail}", evt.OldEmail);
     return msg;
 }
 public SmsMessageFormatter(ApplicationInformation appInfo)
 {
     if (appInfo == null)
     {
         throw new ArgumentNullException("appInfo");
     }
     this.appInfo = new Lazy <ApplicationInformation>(() => appInfo);
 }
 public override string Tokenize(UserAccountEvent accountEvent, ApplicationInformation appInfo, string msg)
 {
     var evt = (CertificateRemovedEvent)accountEvent;
     msg = base.Tokenize(accountEvent, appInfo, msg);
     msg = msg.Replace("{thumbprint}", evt.Certificate.Thumbprint);
     msg = msg.Replace("{subject}", evt.Certificate.Subject);
     return msg;
 }
示例#7
0
            public override string Tokenize(UserAccountEvent accountEvent, ApplicationInformation appInfo, string msg)
            {
                var evt = (CertificateRemovedEvent)accountEvent;

                msg = base.Tokenize(accountEvent, appInfo, msg);
                msg = msg.Replace("{thumbprint}", evt.Certificate.Thumbprint);
                msg = msg.Replace("{subject}", evt.Certificate.Subject);
                return(msg);
            }
 public override string Tokenize(UserAccountEvent accountEvent, ApplicationInformation appInfo, string msg, dynamic extra)
 {
     var evt = (CertificateAddedEvent)accountEvent;
     Func<UserAccountEvent, ApplicationInformation, string, dynamic, string> b = base.Tokenize;
     msg = b(accountEvent, appInfo, msg, extra);
     msg = msg.Replace("{thumbprint}", evt.Certificate.Thumbprint);
     msg = msg.Replace("{subject}", evt.Certificate.Subject);
     return msg;
 }
 public override string Tokenize(UserAccountEvent accountEvent, ApplicationInformation appInfo, string msg, dynamic extra)
 {
     Func<UserAccountEvent, ApplicationInformation, string, dynamic, string> b = base.Tokenize;
     var evt = (EmailChangedEvent)accountEvent;
     msg = b(accountEvent, appInfo, msg, extra);
     msg = msg.Replace("{newEmail}", accountEvent.Account.Email);
     msg = msg.Replace("{oldEmail}", evt.OldEmail);
     return msg;
 }
            public override string Tokenize(UserAccountEvent accountEvent, ApplicationInformation appInfo, string msg)
            {
                var evt = (EmailChangedEvent)accountEvent;

                msg = base.Tokenize(accountEvent, appInfo, msg);
                msg = msg.Replace("{newEmail}", accountEvent.Account.Email);
                msg = msg.Replace("{oldEmail}", evt.OldEmail);
                return(msg);
            }
            public virtual string Tokenize(UserAccountEvent accountEvent, ApplicationInformation appInfo, string msg)
            {
                var user = accountEvent.Account;

                msg = msg.Replace("{username}", user.Username);
                msg = msg.Replace("{email}", user.Email);

                msg = msg.Replace("{applicationName}", appInfo.ApplicationName);
                msg = msg.Replace("{emailSignature}", appInfo.EmailSignature);
                msg = msg.Replace("{loginUrl}", appInfo.LoginUrl);

                msg = msg.Replace("{confirmAccountCreateUrl}", appInfo.VerifyAccountUrl + user.VerificationKey);
                msg = msg.Replace("{cancelNewAccountUrl}", appInfo.CancelNewAccountUrl + user.VerificationKey);

                msg = msg.Replace("{confirmPasswordResetUrl}", appInfo.ConfirmPasswordResetUrl + user.VerificationKey);
                msg = msg.Replace("{confirmChangeEmailUrl}", appInfo.ConfirmChangeEmailUrl + user.VerificationKey);

                return msg;
            }
            public virtual string Tokenize(UserAccountEvent accountEvent, ApplicationInformation appInfo, string msg)
            {
                var user = accountEvent.Account;

                msg = msg.Replace("{username}", user.Username);
                msg = msg.Replace("{email}", user.Email);

                msg = msg.Replace("{applicationName}", appInfo.ApplicationName);
                msg = msg.Replace("{emailSignature}", appInfo.EmailSignature);
                msg = msg.Replace("{loginUrl}", appInfo.LoginUrl);

                msg = msg.Replace("{confirmAccountCreateUrl}", appInfo.VerifyAccountUrl + user.VerificationKey);
                msg = msg.Replace("{cancelNewAccountUrl}", appInfo.CancelNewAccountUrl + user.VerificationKey);

                msg = msg.Replace("{confirmPasswordResetUrl}", appInfo.ConfirmPasswordResetUrl + user.VerificationKey);
                msg = msg.Replace("{confirmChangeEmailUrl}", appInfo.ConfirmChangeEmailUrl + user.VerificationKey);

                return(msg);
            }
 public NotificationService(IMessageDelivery messageDelivery, ApplicationInformation appInfo)
 {
     this.messageDelivery = messageDelivery;
     this.appInfo         = appInfo;
 }
 public NotificationService(IMessageDelivery messageDelivery, ApplicationInformation appInfo)
 {
     this.smtpEventHandler = new EmailEventHandler(new EmailMessageFormatter(appInfo), messageDelivery);
     this.appInfo = appInfo;
 }
 public SmsMessageFormatter(ApplicationInformation appInfo)
 {
     if (appInfo == null) throw new ArgumentNullException("appInfo");
     this.appInfo = new Lazy<ApplicationInformation>(()=>appInfo);
 }
 public override string Tokenize(UserAccountEvent accountEvent, ApplicationInformation appInfo, string msg, dynamic extra)
 {
     Func<UserAccountEvent, ApplicationInformation, string, dynamic, string> b = base.Tokenize;
     var evt = (LinkedAccountRemovedEvent)accountEvent;
     msg = b(accountEvent, appInfo, msg, extra);
     msg = msg.Replace("{provider}", evt.LinkedAccount.ProviderName);
     return msg;
 }
 public NotificationService(IMessageDelivery messageDelivery, ApplicationInformation appInfo)
 {
     this.messageDelivery = messageDelivery;
     this.appInfo = appInfo;
 }
 public TwilloSmsEventHandler(ApplicationInformation appInfo)
     : base(new SmsMessageFormatter(appInfo))
 {
 }
 public NotificationService(IMessageDelivery messageDelivery, ApplicationInformation appInfo)
 {
     this.smtpEventHandler = new EmailEventHandler(new EmailMessageFormatter(appInfo), messageDelivery);
     this.appInfo          = appInfo;
 }