Ejemplo n.º 1
0
        public async Task <ResponseCollection <DynamicContentItemGroup> > GetDynamicContentAsync(string storeId, string[] placeholders)
        {
            var tagQuery = new TagQuery();

            var customerTags = SiteContext.Current.Customer != null ? SiteContext.Current.Customer.Tags : null;

            if (customerTags != null)
            {
                foreach (var tag in customerTags)
                {
                    tagQuery.Add("customer_tag", tag.ToString());
                }
            }

            return(await _marketingClient.GetDynamicContentAsync(storeId, placeholders, tagQuery));
        }
        // Returns id of inserted record or -1 if record already exists
        public int Add(Tag tag)
        {
            int tagId = this.connection.ExecuteScalar <int>(TagQuery.Add(), new { TagName = tag.Name }, this.transaction);

            return(tagId);
        }