private static async Task <SMSResponse> SendScheduledMessageAsync()
        {
            SendMultipleTextualSmsAdvanced smsClient = new SendMultipleTextualSmsAdvanced(BASIC_AUTH_CONFIGURATION);

            Destination destination = new Destination
            {
                To = TO
            };

            DateTimeOffset sendAt = NOW.AddMinutes(10);

            Message message = new Message
            {
                From         = FROM,
                Destinations = new List <Destination>(1)
                {
                    destination
                },
                Text   = "Advanced scheduled message example",
                SendAt = new FormattedDate(sendAt)
            };

            SMSAdvancedTextualRequest request = new SMSAdvancedTextualRequest
            {
                Messages = new List <Message>(1)
                {
                    message
                }
            };

            return(await smsClient.ExecuteAsync(request));
        }
        private static async Task <string> AdvancedSmsAsync()
        {
            Console.WriteLine("-------------------------------");
            Console.WriteLine("Sending fully featured textual message with India DLT regional options...");

            SendMultipleTextualSmsAdvanced smsClient = new SendMultipleTextualSmsAdvanced(BASIC_AUTH_CONFIGURATION);

            Destination destination = new Destination
            {
                To = TO
            };


            IndiaDltOptions indiaDlt = new IndiaDltOptions();

            indiaDlt.ContentTemplateId = "some-content-template-id";
            indiaDlt.PrincipalEntityId = "some-principal-entity-id";

            RegionalOptions regionalOptions = new RegionalOptions();

            regionalOptions.IndiaDlt = indiaDlt;

            Message message = new Message
            {
                From         = FROM,
                Destinations = new List <Destination>(1)
                {
                    destination
                },
                Text     = "Advanced message example with India DLT regional options",
                Regional = regionalOptions
            };

            SMSAdvancedTextualRequest request = new SMSAdvancedTextualRequest
            {
                Messages = new List <Message>(1)
                {
                    message
                }
            };

            SMSResponse smsResponse = await smsClient.ExecuteAsync(request);

            Console.WriteLine("Sending fully featured textual message with India DLT regional options complete.");

            SMSResponseDetails sentMessageInfo = smsResponse.Messages[0];

            Console.WriteLine("-------------------------------");
            Console.WriteLine("Message ID: " + sentMessageInfo.MessageId);
            Console.WriteLine("Receiver: " + sentMessageInfo.To);
            Console.WriteLine("Message status: " + sentMessageInfo.Status.Name);
            Console.WriteLine("-------------------------------");

            return(sentMessageInfo.MessageId);
        }
예제 #3
0
        private static async Task <string> AdvancedSmsAsync()
        {
            Console.WriteLine("-------------------------------");
            Console.WriteLine("Sending fully featured textual message with language...");

            SendMultipleTextualSmsAdvanced smsClient = new SendMultipleTextualSmsAdvanced(BASIC_AUTH_CONFIGURATION);

            Destination destination = new Destination
            {
                To = TO
            };

            Language language = new Language
            {
                LanguageCode = "TR",
                SingleShift  = true,
                LockingShift = true
            };

            Message message = new Message
            {
                From         = FROM,
                Destinations = new List <Destination>(1)
                {
                    destination
                },
                Text            = "Artık Ulusal Dil Tanımlayıcısı ile Türkçe karakterli smslerinizi rahatlıkla iletebilirsiniz.",
                Language        = language,
                Transliteration = "TURKISH"
            };

            SMSAdvancedTextualRequest request = new SMSAdvancedTextualRequest
            {
                Messages = new List <Message>(1)
                {
                    message
                }
            };

            SMSResponse smsResponse = await smsClient.ExecuteAsync(request);

            Console.WriteLine("Sending fully featured textual message with language complete.");

            SMSResponseDetails sentMessageInfo = smsResponse.Messages[0];

            Console.WriteLine("-------------------------------");
            Console.WriteLine("Message ID: " + sentMessageInfo.MessageId);
            Console.WriteLine("Receiver: " + sentMessageInfo.To);
            Console.WriteLine("Message status: " + sentMessageInfo.Status.Name);
            Console.WriteLine("-------------------------------");

            return(sentMessageInfo.MessageId);
        }
예제 #4
0
        private static async Task <string> AdvancedSmsAsync()
        {
            Console.WriteLine("-------------------------------");
            Console.WriteLine("Sending fully featured textual message with tracking...");

            SendMultipleTextualSmsAdvanced smsClient = new SendMultipleTextualSmsAdvanced(BASIC_AUTH_CONFIGURATION);

            Destination destination = new Destination
            {
                To = TO
            };

            Message message = new Message
            {
                From         = FROM,
                Destinations = new List <Destination>(1)
                {
                    destination
                },
                Text = "Advanced message example with tracking"
            };

            Tracking tracking = new Tracking
            {
                Track = "SMS"
            };

            SMSAdvancedTextualRequest request = new SMSAdvancedTextualRequest
            {
                Messages = new List <Message>(1)
                {
                    message
                },
                Tracking = tracking
            };

            SMSResponse smsResponse = await smsClient.ExecuteAsync(request);

            Console.WriteLine("Sending fully featured textual message with tracking complete.");

            SMSResponseDetails sentMessageInfo = smsResponse.Messages[0];

            Console.WriteLine("-------------------------------");
            Console.WriteLine("Message ID: " + sentMessageInfo.MessageId);
            Console.WriteLine("Receiver: " + sentMessageInfo.To);
            Console.WriteLine("Message status: " + sentMessageInfo.Status.Name);
            Console.WriteLine("-------------------------------");

            return(sentMessageInfo.MessageId);
        }
예제 #5
0
        private static async Task <string> AdvancedSmsAsync(string to)
        {
            Console.WriteLine("-------------------------------");
            Console.WriteLine("Sending fully featured textual message...");

            SendMultipleTextualSmsAdvanced smsClient = new SendMultipleTextualSmsAdvanced(BASIC_AUTH_CONFIGURATION);

            Destination destination = new Destination
            {
                To = to
            };

            Message message = new Message
            {
                From         = FROM,
                Destinations = new List <Destination>(1)
                {
                    destination
                },
                Text = "Congratulations, you've won a PassItOn :-)!"
            };

            SMSAdvancedTextualRequest request = new SMSAdvancedTextualRequest
            {
                Messages = new List <Message>(1)
                {
                    message
                }
            };

            SMSResponse smsResponse = await smsClient.ExecuteAsync(request);

            Console.WriteLine("Sending fully featured textual message complete.");

            SMSResponseDetails sentMessageInfo = smsResponse.Messages[0];

            Console.WriteLine("-------------------------------");
            Console.WriteLine("Message ID: " + sentMessageInfo.MessageId);
            Console.WriteLine("Receiver: " + sentMessageInfo.To);
            Console.WriteLine("Message status: " + sentMessageInfo.Status.Name);
            Console.WriteLine("-------------------------------");

            return(sentMessageInfo.MessageId);
        }