示例#1
0
        public virtual IDictionary <string, object> ToDictionary(Transmission transmission)
        {
            var result = WithCommonConventions(transmission, new Dictionary <string, object>
            {
                ["recipients"] = transmission.ListId != null
                    ? (object)new Dictionary <string, object> {
                    ["list_id"] = transmission.ListId
                }
                    : transmission.Recipients.Select(ToDictionary)
            });

            CcHandling.SetAnyCCsInTheHeader(transmission, result);

            return(result);
        }
示例#2
0
        public virtual IDictionary <string, object> ToDictionary(Transmission transmission)
        {
            var data = new Dictionary <string, object>
            {
                ["substitution_data"] =
                    transmission.SubstitutionData != null && transmission.SubstitutionData.Keys.Any()
                        ? transmission.SubstitutionData
                        : null,
                ["recipients"] = transmission.ListId != null
                    ? (object)new Dictionary <string, object> {
                    ["list_id"] = transmission.ListId
                }
                    : transmission.Recipients.Select(ToDictionary)
            };

            var result = WithCommonConventions(transmission, data);

            CcHandling.SetAnyCCsInTheHeader(transmission, result);

            return(result);
        }