{"id":572,"date":"2021-04-12T22:39:09","date_gmt":"2021-04-12T22:39:09","guid":{"rendered":"https:\/\/www.naveedulhaq.com\/?p=572"},"modified":"2023-02-21T22:53:43","modified_gmt":"2023-02-21T22:53:43","slug":"episerver-coupon-codes-tool-dynamically-assign-coupon-codes-to-customers","status":"publish","type":"post","link":"https:\/\/www.naveedulhaq.com\/index.php\/episerver\/episerver-coupon-codes-tool-dynamically-assign-coupon-codes-to-customers\/","title":{"rendered":"Episerver Coupon codes Tool: Dynamically assign coupon codes to customers"},"content":{"rendered":"\n<p>This blog post is a continuity of the last two blog posts regarding extending the Episerver Coupon Codes Tool. <\/p>\n\n\n\n<p><a href=\"https:\/\/www.naveedulhaq.com\/index.php\/episerver\/episerver-coupon-codes-tool-download-single-use-coupons\/\">Episerver Coupon codes Tool: Download single-use coupons<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/www.naveedulhaq.com\/index.php\/episerver\/episerver-coupon-codes-tool-delete-expired-unused-coupons\/\">Episerver Coupon codes Tool: Delete expired \/ unused coupons<\/a><\/p>\n\n\n\n<p>Episerver foundation team has now added extended code to the Foundation starter website.<\/p>\n\n\n\n<p>Now we have a tool to create bulk coupon codes and we have the ability to download these coupon codes in CSV and send them to an external system to use in email marketing.<\/p>\n\n\n\n<p>There are times when customers click on an email link and comes to our website and we want to give the customer an incentive to make a purchase. We will record the customer&#8217;s visit and assign a unique time-limited coupon code and we can show this coupon code on-page as well to encourage the customer to buy. <\/p>\n\n\n\n<p>For this example, the links in emails should have appropriate promotion Id (int) and customer Id (guide). You can modify it according to your need.  <\/p>\n\n\n\n<p>First of all, we need to create a Store procedure. This store procedure takes CustomerId and Promotion Id and assign Customer id to a unique coupon code and return this code to show on-page.<\/p>\n\n\n\n<p>Store Procedure: UniqueCoupons_AssignCouponToCustomer<\/p>\n\n\n\n<pre><code>USE &#91;epicommerce]\nGO\nSET ANSI_NULLS ON\nGO\nSET QUOTED_IDENTIFIER OFF\nGO\ncreate PROCEDURE &#91;dbo].&#91;UniqueCoupons_AssignCouponToCustomer]\n(\n@CustomerId uniqueidentifier,\n@Id BIGINT\n)\nAS\nBEGIN\nUpdate top(1) UniqueCoupons\nSet CustomerId = @CustomerId\nwhere\nPromotionId = @Id\nSELECT * FROM UniqueCoupons\nWHERE CustomerId = @CustomerId and PromotionId = @Id\nEND<\/code><\/pre>\n\n\n\n<p> Now we need to update UniqueCouponService to call this store procedure. I have created a new method &#8220;AssignCouponToCustomer&#8221;<\/p>\n\n\n\n<pre><code>public UniqueCoupon AssignCouponToCustomer(int id, Guid customerid)\n        {\n            try\n            {\n                UniqueCoupon coupon = null;\n                var connectionString = &#91;Connection String];\n                using (var connection = new SqlConnection(connectionString))\n                {\n                    connection.Open();\n                    var command = new SqlCommand\n                    {\n                        Connection = connection,\n                        CommandType = CommandType.StoredProcedure,\n                        CommandText = \"UniqueCoupons_AssignCouponToCustomer\"\n                    };\n                    command.Parameters.Add(new SqlParameter(\"@CustomerId\", customerid));\n                    command.Parameters.Add(new SqlParameter(\"@Id\", id));\n                    using (var reader = command.ExecuteReader())\n                    {\n                        while (reader.Read())\n                        {\n                            coupon = GetUniqueCoupon(reader);\n                        }\n                    }\n                }\n                return coupon;\n            }\n            catch (Exception exn)\n            {\n                _logger.Error(exn.Message, exn);\n            }\n            return null;\n        }<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Dynamic Coupon Code Block<\/h2>\n\n\n\n<p>Now next step to utilize the UniqueCouponService method AssignCouponToCustomer and assign a unique coupon code to the customer records.<\/p>\n\n\n\n<p>I have created a block with a Custom controller to implement this functionality because<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Block can show Coupon code on page and you can use it on any page with content area<\/li>\n\n\n\n<li>Block can be used with combination of visitor group personalization<\/li>\n\n\n\n<li>Blocks have their own controller \/ view. So separation of logic.<\/li>\n<\/ul>\n\n\n\n<p>Below is a code snippet of my Dynamic Coupon Code Block controller &amp; ViewModel<\/p>\n\n\n\n<pre><code>&#91;TemplateDescriptor(Inherited = true,\n        TemplateTypeCategory = TemplateTypeCategories.MvcPartialController,\n        Default = true,\n        AvailableWithoutTag = true)]\n    public class DynamicCouponCodeBlockController : BlockController&lt;DynamicCouponCodeBlock>\n    {\n        private readonly ICouponService _couponService;\n        public DynamicCouponCodeBlockController(ICouponService couponService)\n        {\n            _couponService = couponService;\n        }\n        public override ActionResult Index(DynamicCouponCodeBlock currentBlock)\n        {\n            var strPrmotionId = Request.QueryString&#91;\"Id\"] ?? string.Empty;\n            var strCustId = Request.QueryString&#91;\"cId\"] ?? string.Empty;\n            var promotionId = int.Parse(strPrmotionId);\n            Guid newGuid = Guid.Parse(strCustId);\n            var coupon = _couponService.AssignCouponToCustomer(promotionId, newGuid);\n            var viewModel = new DynamicCouponCodeBlockViewModel(currentBlock)\n            {\n                CouponCode = coupon\n            };\n            return PartialView(\"DynamicCouponCodeBlock\", viewModel);\n        }\n    }\npublic class DynamicCouponCodeBlockViewModel : BlockViewModel&lt;DynamicCouponCodeBlock>\n    {\n        public DynamicCouponCodeBlockViewModel(DynamicCouponCodeBlock currentBlock) : base(currentBlock)\n        {\n        }\n        public UniqueCoupon CouponCode { get; set; }\n       \n    }<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This blog post is a continuity of the last two blog posts regarding extending the Episerver Coupon Codes Tool. Episerver Coupon codes Tool: Download single-use&#8230;<\/p>\n","protected":false},"author":1,"featured_media":599,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[68,13,63,22,91,61],"class_list":["post-572","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-episerver","tag-content-cloud","tag-episerver","tag-optimizely","tag-episerver-commerce","tag-optimizely-customized-commerce","tag-promotions"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Episerver Coupon Codes : Dynamically assign coupon codes to customers<\/title>\n<meta name=\"description\" content=\"Episerver Coupon codes Tool: Dynamically assign coupon codes to customers - Naveed Ul-Haq&#039;s blog AI, Optimizely, Azure &amp; more\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.naveedulhaq.com\/index.php\/episerver\/episerver-coupon-codes-tool-dynamically-assign-coupon-codes-to-customers\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Episerver Coupon Codes : Dynamically assign coupon codes to customers\" \/>\n<meta property=\"og:description\" content=\"Episerver Coupon codes Tool: Dynamically assign coupon codes to customers - Naveed Ul-Haq&#039;s blog AI, Optimizely, Azure &amp; more\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.naveedulhaq.com\/index.php\/episerver\/episerver-coupon-codes-tool-dynamically-assign-coupon-codes-to-customers\/\" \/>\n<meta property=\"og:site_name\" content=\"Naveed Ul-Haq&#039;s blog\" \/>\n<meta property=\"article:published_time\" content=\"2021-04-12T22:39:09+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-02-21T22:53:43+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2021\/08\/optimizely.png\" \/>\n\t<meta property=\"og:image:width\" content=\"232\" \/>\n\t<meta property=\"og:image:height\" content=\"235\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Naveed Ul-Haq\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Naveed Ul-Haq\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/episerver\\\/episerver-coupon-codes-tool-dynamically-assign-coupon-codes-to-customers\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/episerver\\\/episerver-coupon-codes-tool-dynamically-assign-coupon-codes-to-customers\\\/\"},\"author\":{\"name\":\"Naveed Ul-Haq\",\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/#\\\/schema\\\/person\\\/dd6db5980b965fcae41e096d357c65c9\"},\"headline\":\"Episerver Coupon codes Tool: Dynamically assign coupon codes to customers\",\"datePublished\":\"2021-04-12T22:39:09+00:00\",\"dateModified\":\"2023-02-21T22:53:43+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/episerver\\\/episerver-coupon-codes-tool-dynamically-assign-coupon-codes-to-customers\\\/\"},\"wordCount\":319,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/#\\\/schema\\\/person\\\/dd6db5980b965fcae41e096d357c65c9\"},\"image\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/episerver\\\/episerver-coupon-codes-tool-dynamically-assign-coupon-codes-to-customers\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.naveedulhaq.com\\\/wp-content\\\/uploads\\\/2021\\\/08\\\/optimizely.png\",\"keywords\":[\"content cloud\",\"episerver\",\"Optimizely\",\"Optimizely Customized Commerce\",\"Optimizely Customized Commerce\",\"promotions\"],\"articleSection\":[\"Optimizely\"],\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/episerver\\\/episerver-coupon-codes-tool-dynamically-assign-coupon-codes-to-customers\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/episerver\\\/episerver-coupon-codes-tool-dynamically-assign-coupon-codes-to-customers\\\/\",\"url\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/episerver\\\/episerver-coupon-codes-tool-dynamically-assign-coupon-codes-to-customers\\\/\",\"name\":\"Episerver Coupon Codes : Dynamically assign coupon codes to customers\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/episerver\\\/episerver-coupon-codes-tool-dynamically-assign-coupon-codes-to-customers\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/episerver\\\/episerver-coupon-codes-tool-dynamically-assign-coupon-codes-to-customers\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.naveedulhaq.com\\\/wp-content\\\/uploads\\\/2021\\\/08\\\/optimizely.png\",\"datePublished\":\"2021-04-12T22:39:09+00:00\",\"dateModified\":\"2023-02-21T22:53:43+00:00\",\"description\":\"Episerver Coupon codes Tool: Dynamically assign coupon codes to customers - Naveed Ul-Haq&#039;s blog AI, Optimizely, Azure &amp; more\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/episerver\\\/episerver-coupon-codes-tool-dynamically-assign-coupon-codes-to-customers\\\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/episerver\\\/episerver-coupon-codes-tool-dynamically-assign-coupon-codes-to-customers\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/episerver\\\/episerver-coupon-codes-tool-dynamically-assign-coupon-codes-to-customers\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.naveedulhaq.com\\\/wp-content\\\/uploads\\\/2021\\\/08\\\/optimizely.png\",\"contentUrl\":\"https:\\\/\\\/www.naveedulhaq.com\\\/wp-content\\\/uploads\\\/2021\\\/08\\\/optimizely.png\",\"width\":232,\"height\":235,\"caption\":\"optimizely (Episerver)\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/episerver\\\/episerver-coupon-codes-tool-dynamically-assign-coupon-codes-to-customers\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.naveedulhaq.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Episerver Coupon codes Tool: Dynamically assign coupon codes to customers\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/#website\",\"url\":\"https:\\\/\\\/www.naveedulhaq.com\\\/\",\"name\":\"Naveed Ul-Haq's blog\",\"description\":\"AI, Optimizely, Azure &amp; more\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/#\\\/schema\\\/person\\\/dd6db5980b965fcae41e096d357c65c9\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.naveedulhaq.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/#\\\/schema\\\/person\\\/dd6db5980b965fcae41e096d357c65c9\",\"name\":\"Naveed Ul-Haq\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g\",\"caption\":\"Naveed Ul-Haq\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g\"},\"description\":\"I lead engineering delivery teams for digital commerce and digital experience platforms, combining hands-on architecture experience with strong delivery governance. Over 20+ years, I\u2019ve built and led cross\u2011functional teams (engineering, BA, QA) delivering modern cloud solutions on Azure, microservices, APIs and eCommerce\\\/CMS platforms. My recent focus includes AI-enabled commerce automation: product ingestion and enrichment workflows, content optimisation for SEO and shopping feeds, and agentic tooling to improve marketing and accessibility workflows. I\u2019m passionate about building high-performing teams, establishing quality\\\/release standards, and delivering measurable outcomes across performance, reliability, and speed of change.\",\"sameAs\":[\"https:\\\/\\\/www.naveedulhaq.com\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/naveedulhaq\\\/\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Episerver Coupon Codes : Dynamically assign coupon codes to customers","description":"Episerver Coupon codes Tool: Dynamically assign coupon codes to customers - Naveed Ul-Haq&#039;s blog AI, Optimizely, Azure &amp; more","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.naveedulhaq.com\/index.php\/episerver\/episerver-coupon-codes-tool-dynamically-assign-coupon-codes-to-customers\/","og_locale":"en_GB","og_type":"article","og_title":"Episerver Coupon Codes : Dynamically assign coupon codes to customers","og_description":"Episerver Coupon codes Tool: Dynamically assign coupon codes to customers - Naveed Ul-Haq&#039;s blog AI, Optimizely, Azure &amp; more","og_url":"https:\/\/www.naveedulhaq.com\/index.php\/episerver\/episerver-coupon-codes-tool-dynamically-assign-coupon-codes-to-customers\/","og_site_name":"Naveed Ul-Haq&#039;s blog","article_published_time":"2021-04-12T22:39:09+00:00","article_modified_time":"2023-02-21T22:53:43+00:00","og_image":[{"width":232,"height":235,"url":"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2021\/08\/optimizely.png","type":"image\/png"}],"author":"Naveed Ul-Haq","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Naveed Ul-Haq","Estimated reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.naveedulhaq.com\/index.php\/episerver\/episerver-coupon-codes-tool-dynamically-assign-coupon-codes-to-customers\/#article","isPartOf":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/episerver\/episerver-coupon-codes-tool-dynamically-assign-coupon-codes-to-customers\/"},"author":{"name":"Naveed Ul-Haq","@id":"https:\/\/www.naveedulhaq.com\/#\/schema\/person\/dd6db5980b965fcae41e096d357c65c9"},"headline":"Episerver Coupon codes Tool: Dynamically assign coupon codes to customers","datePublished":"2021-04-12T22:39:09+00:00","dateModified":"2023-02-21T22:53:43+00:00","mainEntityOfPage":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/episerver\/episerver-coupon-codes-tool-dynamically-assign-coupon-codes-to-customers\/"},"wordCount":319,"commentCount":0,"publisher":{"@id":"https:\/\/www.naveedulhaq.com\/#\/schema\/person\/dd6db5980b965fcae41e096d357c65c9"},"image":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/episerver\/episerver-coupon-codes-tool-dynamically-assign-coupon-codes-to-customers\/#primaryimage"},"thumbnailUrl":"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2021\/08\/optimizely.png","keywords":["content cloud","episerver","Optimizely","Optimizely Customized Commerce","Optimizely Customized Commerce","promotions"],"articleSection":["Optimizely"],"inLanguage":"en-GB","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.naveedulhaq.com\/index.php\/episerver\/episerver-coupon-codes-tool-dynamically-assign-coupon-codes-to-customers\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.naveedulhaq.com\/index.php\/episerver\/episerver-coupon-codes-tool-dynamically-assign-coupon-codes-to-customers\/","url":"https:\/\/www.naveedulhaq.com\/index.php\/episerver\/episerver-coupon-codes-tool-dynamically-assign-coupon-codes-to-customers\/","name":"Episerver Coupon Codes : Dynamically assign coupon codes to customers","isPartOf":{"@id":"https:\/\/www.naveedulhaq.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/episerver\/episerver-coupon-codes-tool-dynamically-assign-coupon-codes-to-customers\/#primaryimage"},"image":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/episerver\/episerver-coupon-codes-tool-dynamically-assign-coupon-codes-to-customers\/#primaryimage"},"thumbnailUrl":"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2021\/08\/optimizely.png","datePublished":"2021-04-12T22:39:09+00:00","dateModified":"2023-02-21T22:53:43+00:00","description":"Episerver Coupon codes Tool: Dynamically assign coupon codes to customers - Naveed Ul-Haq&#039;s blog AI, Optimizely, Azure &amp; more","breadcrumb":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/episerver\/episerver-coupon-codes-tool-dynamically-assign-coupon-codes-to-customers\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.naveedulhaq.com\/index.php\/episerver\/episerver-coupon-codes-tool-dynamically-assign-coupon-codes-to-customers\/"]}]},{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.naveedulhaq.com\/index.php\/episerver\/episerver-coupon-codes-tool-dynamically-assign-coupon-codes-to-customers\/#primaryimage","url":"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2021\/08\/optimizely.png","contentUrl":"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2021\/08\/optimizely.png","width":232,"height":235,"caption":"optimizely (Episerver)"},{"@type":"BreadcrumbList","@id":"https:\/\/www.naveedulhaq.com\/index.php\/episerver\/episerver-coupon-codes-tool-dynamically-assign-coupon-codes-to-customers\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.naveedulhaq.com\/"},{"@type":"ListItem","position":2,"name":"Episerver Coupon codes Tool: Dynamically assign coupon codes to customers"}]},{"@type":"WebSite","@id":"https:\/\/www.naveedulhaq.com\/#website","url":"https:\/\/www.naveedulhaq.com\/","name":"Naveed Ul-Haq's blog","description":"AI, Optimizely, Azure &amp; more","publisher":{"@id":"https:\/\/www.naveedulhaq.com\/#\/schema\/person\/dd6db5980b965fcae41e096d357c65c9"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.naveedulhaq.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":["Person","Organization"],"@id":"https:\/\/www.naveedulhaq.com\/#\/schema\/person\/dd6db5980b965fcae41e096d357c65c9","name":"Naveed Ul-Haq","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/secure.gravatar.com\/avatar\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g","caption":"Naveed Ul-Haq"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g"},"description":"I lead engineering delivery teams for digital commerce and digital experience platforms, combining hands-on architecture experience with strong delivery governance. Over 20+ years, I\u2019ve built and led cross\u2011functional teams (engineering, BA, QA) delivering modern cloud solutions on Azure, microservices, APIs and eCommerce\/CMS platforms. My recent focus includes AI-enabled commerce automation: product ingestion and enrichment workflows, content optimisation for SEO and shopping feeds, and agentic tooling to improve marketing and accessibility workflows. I\u2019m passionate about building high-performing teams, establishing quality\/release standards, and delivering measurable outcomes across performance, reliability, and speed of change.","sameAs":["https:\/\/www.naveedulhaq.com","https:\/\/www.linkedin.com\/in\/naveedulhaq\/"]}]}},"_links":{"self":[{"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/posts\/572","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/comments?post=572"}],"version-history":[{"count":0,"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/posts\/572\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/media\/599"}],"wp:attachment":[{"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/media?parent=572"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/categories?post=572"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/tags?post=572"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}