コード例 #1
0
 public void NotifyAdminGroup(string subject, string message)
 {
     try
     {
         _notifyService.SendMessage(subject, message, _configService.GetAdminGroupMailAddresses());
     }
     catch (ConfigurationException ex)
     {
         throw new ApplicationException("Error in Smtp client configuration.", ex);
     }
     catch (MessageNotSentException ex)
     {
         throw new BookingDomainValidationException(ErrorCodesConst.MESSAGE_NOT_SENT, Messages_RU.MESSAGE_NOT_SENT, ex);
     }
     catch (ApplicationException ex)
     {
         throw new ApplicationException("Exception occurred while sending mail to Admin group.", ex);
     }
 }
コード例 #2
0
ファイル: Board.cs プロジェクト: dheesh/online-werewolf
 public void NotifyPlayers()
 {
     if (isRolesAssigned)
     {
         foreach (var player in players)
         {
             MessageModel messageDto = new MessageModel()
             {
                 Contact = player.Contact,
                 Message = $"Your {player.PlayerName}:Werewolf code is {player.GetRoleName()}"
             };
             notifier.SendMessage(messageDto);
         }
     }
 }