예제 #1
0
        public static Task AddTelegramGroupNotification(this UsersAPI UsersAPI,
                                                        User_Id UserId,
                                                        String Username,
                                                        Int32?ChatId        = null,
                                                        String SharedSecret = null,
                                                        String TextTemplate = null)

        => UsersAPI.AddNotification(UserId,
                                    new TelegramGroupNotification(Username,
                                                                  ChatId,
                                                                  SharedSecret,
                                                                  TextTemplate));
예제 #2
0
        public static Task AddTelegramGroupNotification(this UsersAPI UsersAPI,
                                                        User_Id UserId,
                                                        IEnumerable <NotificationMessageType> NotificationMessageTypes,
                                                        String Username,
                                                        Int32?ChatId        = null,
                                                        String SharedSecret = null,
                                                        String TextTemplate = null)

        => UsersAPI.AddNotification(UserId,
                                    new TelegramGroupNotification(Username,
                                                                  ChatId,
                                                                  SharedSecret,
                                                                  TextTemplate),
                                    NotificationMessageTypes);
예제 #3
0
        public static Task AddEMailNotification(this UsersAPI UsersAPI,
                                                User User,
                                                IEnumerable <NotificationMessageType> NotificationMessageTypes,
                                                EMailAddress EMailAddress        = null,
                                                String Subject                   = null,
                                                String SubjectPrefix             = null,
                                                EventTracking_Id EventTrackingId = null,
                                                User_Id?CurrentUserId            = null)

        => UsersAPI.AddNotification(User,
                                    new EMailNotification(EMailAddress ?? User.EMail,
                                                          Subject,
                                                          SubjectPrefix),
                                    NotificationMessageTypes,
                                    EventTrackingId,
                                    CurrentUserId);
예제 #4
0
        public static Task AddHTTPSNotification(this UsersAPI UsersAPI,
                                                User User,
                                                IEnumerable <NotificationMessageType> NotificationMessageTypes,
                                                String URL,
                                                HTTPMethod?Method         = null,
                                                IPPort?TCPPort            = null,
                                                String BasicAuth_Login    = null,
                                                String BasicAuth_Password = null,
                                                String APIKey             = null)

        => UsersAPI.AddNotification(User,
                                    new HTTPSNotification(URL,
                                                          Method,
                                                          TCPPort,
                                                          BasicAuth_Login,
                                                          BasicAuth_Password,
                                                          APIKey),
                                    NotificationMessageTypes);
예제 #5
0
        public static Task AddTelegramNotification(this UsersAPI UsersAPI,
                                                   User User,
                                                   IEnumerable <NotificationMessageType> NotificationMessageTypes,
                                                   String Username,
                                                   Int32?ChatId        = null,
                                                   String SharedSecret = null,
                                                   String TextTemplate = null,
                                                   EventTracking_Id EventTrackingId = null,
                                                   User_Id?CurrentUserId            = null)

        => UsersAPI.AddNotification(User,
                                    new TelegramNotification(Username,
                                                             ChatId,
                                                             SharedSecret,
                                                             TextTemplate),
                                    NotificationMessageTypes,
                                    EventTrackingId,
                                    CurrentUserId);
예제 #6
0
        public static Task AddSMSNotification(this UsersAPI UsersAPI,
                                              User User,
                                              IEnumerable <NotificationMessageType> NotificationMessageTypes,
                                              PhoneNumber?PhoneNumber          = null,
                                              String TextTemplate              = null,
                                              EventTracking_Id EventTrackingId = null,
                                              User_Id?CurrentUserId            = null)
        {
            var phoneNumber = PhoneNumber ?? User.MobilePhone;

            if (!phoneNumber.HasValue || phoneNumber.Value.IsNullOrEmpty)
            {
                throw new ArgumentNullException(nameof(PhoneNumber), "The given mobile phone number must not be null or empty!");
            }

            return(UsersAPI.AddNotification(User,
                                            new SMSNotification(phoneNumber.Value,
                                                                TextTemplate),
                                            NotificationMessageTypes,
                                            EventTrackingId,
                                            CurrentUserId));
        }