public static string[] FailoverOptions(this Recipient r, CommunicationManifest communicationManifest)
        {
            var failoverOptions =
                (r.FailoverOptions ?? communicationManifest.FailoverOptions ?? new string[0]).ToArray();

            return(failoverOptions);
        }
 public static IEnumerable <ITableEntity> PrepareCommMessage(this CommunicationManifest cm, string sessionId, IMessageIdGenerator idGenerator, DateTime prepareDateTime)
 {
     // ParseMessage function
     (int order, string type, Recipient recipient, object message)[] ParseMessage(Recipient r)
        public static DateTime DeliverySchedule(this Recipient r, CommunicationManifest communicationManifest, DateTime defaultTo)
        {
            var delivery = r.ScheduleTime ?? communicationManifest.ScheduleTime ?? defaultTo;

            return(delivery);
        }
Example #4
0
        public void GetCommunicationManifestJsonTest()
        {
            var cm = new CommunicationManifest()
            {
                CommunicationReference = "CommunicationReference01",
                Title      = "Test Title",
                Recipients = new List <Recipient>()
                {
                    new Recipient()
                    {
                        RecipientReference = "RecipientReference01",

                        Sms = new Sms()
                        {
                            Mobile = "0430 121 212",

                            SmsContent = "Sms Txt",
                        },
                        Email = new Email()
                        {
                            EmailSubject = "EmailSubject",
                            EmailAddress = "EmailAddress",
                            EmailContent = "EmailContent",
                            Attachments  = new[]
                            {
                                "Email file1.pdf",
                            },
                        },

                        Postage = new Postage()
                        {
                            FirstName = "FirstName",
                            LastName  = "LastName",
                            Company   = "Company",
                            Address   = new Address()
                            {
                                Line1    = "Line1",
                                Line2    = "Line2",
                                Line3    = "Line3",
                                Suburb   = "Melbourne",
                                State    = "VIC",
                                Postcode = "3000",
                                Country  = "AU"
                            },
                            Attachments = new[]
                            {
                                "Postage file1.pdf",
                            },
                        },

                        FailoverOptions = new []
                        {
                            "Email", "Sms", "Postage"
                        },
                        Attachments = new[]
                        {
                            "Recipient file.pdf",
                        },
                    },
                    new Recipient()
                    {
                        RecipientReference = "RecipientReference02",

                        Sms = new Sms()
                        {
                            Mobile = "0430 000 212",

                            SmsContent = "Sms02 Txt",
                        },
                        Email = new Email()
                        {
                            EmailSubject = "EmailSubject02",
                            EmailAddress = "EmailAddress02",
                            EmailContent = "EmailContent02",
                            Attachments  = new[]
                            {
                                "Email2 file1.pdf",
                            },
                        },

                        Attachments = new[]
                        {
                            "Recipient2 file.pdf",
                        },
                    }
                },

                FailoverOptions = new[]
                {
                    "Sms", "Email", "Postage"
                },
                Attachments = new[]
                {
                    "Common file.pdf",
                }
            };

            _output.WriteLine(cm.ToJson(Formatting.Indented));
        }