Пример #1
0
        public static string SendPushNotification(int templateId, string token, OperationSystem os, Dictionary <string, Object> information = null, BNRequest bnRequest = null)
        {
            PushNotificationDistribution messageDistribution = new PushNotificationDistribution()
            {
                bnRequst = bnRequest,
                Template = new Template {
                    Id = templateId
                },
                To = new List <IContact>()
                {
                    new Contact()
                    {
                        Token = token, OS = os, Info = information
                    }
                }
            };

            return(SendMessage(messageDistribution));
        }
Пример #2
0
        public static string SendEmail(int templateId, string email, Dictionary <string, Object> information = null, BNRequest bnRequest = null)
        {
            EmailMessageDistribution messageDistribution = new EmailMessageDistribution()
            {
                bnRequst = bnRequest,
                Template = new Template {
                    Id = templateId
                },
                To = new List <IContact>()
                {
                    new Contact()
                    {
                        Email = email, Info = information
                    }
                }
            };

            return(SendMessage(messageDistribution));
        }
Пример #3
0
        public static string SendSms(int templateId, string phoneNumber, Dictionary <string, Object> information = null, BNRequest bnRequest = null)
        {
            SmsMessageDistribution messageDistribution = new SmsMessageDistribution()
            {
                bnRequst = bnRequest,
                Template = new Template {
                    Id = templateId
                },
                To = new List <IContact>()
                {
                    new Contact()
                    {
                        PhoneNumber = phoneNumber, Info = information
                    }
                }
            };

            return(SendMessage(messageDistribution));
        }