示例#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));
        }