Exemple #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 Task NotifyAsync(string token, UserManager <TUser> manager, TUser user,
                                  CancellationToken cancellationToken = default(CancellationToken))
 {
     if (manager == null)
     {
         throw new ArgumentNullException("manager");
     }
     return(manager.SendSmsAsync(user, String.Format(CultureInfo.CurrentCulture, MessageFormat, token), cancellationToken));
 }
 /// <summary>
 ///     Send text message using the given message
 /// </summary>
 /// <typeparam name="TUser"></typeparam>
 /// <typeparam name="TKey"></typeparam>
 /// <param name="manager"></param>
 /// <param name="userId"></param>
 /// <param name="message"></param>
 public static void SendSms <TUser, TKey>(this UserManager <TUser, TKey> manager, TKey userId, string message)
     where TKey : IEquatable <TKey>
     where TUser : class, IUser <TKey>
 {
     if (manager == null)
     {
         throw new ArgumentNullException("manager");
     }
     AsyncHelper.RunSync(() => manager.SendSmsAsync(userId, message));
 }