示例#1
0
 /// <summary>
 ///     Notifies the user with a token via SMS using the MessageFormat
 /// </summary>
 /// <param name="token"></param>
 /// <param name="manager"></param>
 /// <param name="user"></param>
 /// <returns></returns>
 public override async Task NotifyAsync(string token, UserManager <TUser> manager, TUser user,
                                        CancellationToken cancellationToken = default(CancellationToken))
 {
     if (manager == null)
     {
         throw new ArgumentNullException("manager");
     }
     var msg = new IdentityMessage
     {
         Destination = await manager.GetPhoneNumberAsync(user, cancellationToken),
         Body        = string.Format(CultureInfo.CurrentCulture, Options.MessageFormat, token)
     };
     await manager.SendMessageAsync(Options.MessageProvider, msg, cancellationToken);
 }