{"id":415,"date":"2021-02-20T21:33:31","date_gmt":"2021-02-20T21:33:31","guid":{"rendered":"https:\/\/www.naveedulhaq.com\/?p=415"},"modified":"2021-02-20T21:33:33","modified_gmt":"2021-02-20T21:33:33","slug":"episerver-coupon-codes-tool-delete-expired-unused-coupons","status":"publish","type":"post","link":"https:\/\/www.naveedulhaq.com\/index.php\/episerver\/episerver-coupon-codes-tool-delete-expired-unused-coupons\/","title":{"rendered":"Episerver Coupon codes Tool: Delete expired \/ unused coupons"},"content":{"rendered":"\n<p>This blog is the second part of <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>. Let&#8217;s further extend the Coupon codes tool.<\/p>\n\n\n\n<p>Once the website starts generating thousands or millions of coupon codes, it&#8217;s imminent that we need to create house-keeping functionality. We need functionality to delete expired voucher codes because we do not want the database to be flooded with expired coupon codes. <\/p>\n\n\n\n<p>We also needs an ability to bulk delete existing coupon codes because of various reasons.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Codes might get generated by mistake<\/li><li>The campaign is no longer active<\/li><li>Or we simply do not need these codes<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Bulk Delete button<\/h2>\n\n\n\n<p>In the last blog, we created the Bulk operations section. We can add a new button in this session that will delete all existing coupon codes in the currently selected campaign discount.<\/p>\n\n\n\n<p>Now UniqueCouponService already has a method DeleteByPromotionId. This method takes PromotionCode and delete all coupon codes for this promotion and invalidate the cache. <\/p>\n\n\n\n<pre><code>        public bool DeleteByPromotionId(int id)\n        {\n            try\n            {\n                var connectionString = _connectionHandler.Commerce.ConnectionString;\n                using (var connection = new SqlConnection(connectionString))\n                {\n                    connection.Open();\n                    using (var transaction = connection.BeginTransaction())\n                    {\n                        var command = new SqlCommand\n                        {\n                            Connection = transaction.Connection,\n                            Transaction = transaction,\n                            CommandType = CommandType.StoredProcedure,\n                            CommandText = \"UniqueCoupons_DeleteByPromotionId\"\n                        };\n                        command.Parameters.Add(new SqlParameter(\"@PromotionId\", id));\n                        command.ExecuteNonQuery();\n                        transaction.Commit();\n                    }\n                    InvalidatePromotionCache(id);\n                }\n\n                return true;\n            }\n            catch (Exception exn)\n            {\n                _logger.Error(exn.Message, exn);\n            }\n\n            return false;\n        }<\/code><\/pre>\n\n\n\n<p>for now, i&#8217;m going to use this method for delete.<\/p>\n\n\n\n<p>The first step is to create Delete All button in EditPromotionCoupons.cshtml<\/p>\n\n\n\n<p>The complete code of EditPromotionCoupons.cshtml will be as follow<\/p>\n\n\n\n<pre><code>@using EPiServer.Shell\n\n@inherits WebViewPage&lt;Foundation.Commerce.Marketing.PromotionCouponsViewModel>\n\n&lt;head>\n    &lt;title>Edit promotion coupons&lt;\/title>\n&lt;\/head>\n&lt;main class=\"dash-content\">\n    &lt;div class=\"container-fluid\">\n        &lt;div class=\"row\">\n            &lt;div class=\"col-12\">\n                &lt;h3>Manage Coupon Codes for Promotion @Model.Promotion.Name&lt;\/h3>\n                &lt;div class=\"card spur-card\">\n                    &lt;div class=\"card-header\">\n                        &lt;div class=\"spur-card-icon\">\n                            &lt;i data-feather=\"gift\">&lt;\/i>\n                        &lt;\/div>\n                        &lt;div class=\"spur-card-title\">Generate coupons&lt;\/div>\n                    &lt;\/div>\n                    &lt;div class=\"card-body\">\n                        @using (Html.BeginForm(\"Generate\", \"SingleUseCoupon\", FormMethod.Post, new { @class = \"form-horizontal\" }))\n                        {\n                            @Html.AntiForgeryToken()\n                            @Html.HiddenFor(x => x.PromotionId)\n                            &lt;div class=\"form-row\">\n                                &lt;div class=\"form-group col-md-6 col-xl-3\">\n                                    @Html.LabelFor(x => x.ValidFrom)\n                                    @Html.TextBoxFor(x => x.ValidFrom, new { @class = \"form-control\", @type = \"date\" })\n                                &lt;\/div>\n                                &lt;div class=\"form-group col-md-6 col-xl-3\">\n                                    @Html.LabelFor(x => x.Expiration)\n                                    @Html.TextBoxFor(x => x.Expiration, new { @class = \"form-control\", @type = \"date\" })\n                                &lt;\/div>\n                                &lt;div class=\"form-group col-md-6 col-xl-3\">\n                                    @Html.LabelFor(x => x.Quantity)\n                                    @Html.TextBoxFor(x => x.Quantity, new { @class = \"form-control\", @type = \"number\" })\n                                &lt;\/div>\n                                &lt;div class=\"form-group col-md-6 col-xl-3\">\n                                    @Html.LabelFor(x => x.MaxRedemptions)\n                                    @Html.TextBoxFor(x => x.MaxRedemptions, new { @class = \"form-control\", @type = \"number\" })\n                                &lt;\/div>\n                            &lt;\/div>\n                            &lt;button type=\"submit\" class=\"btn btn-primary\">Generate&lt;\/button>\n                        }\n                        \n                        &lt;br \/>\n                        &lt;div class=\"row\">\n                            &lt;div class=\"col-12\">\n                                &lt;h3>Bulk operations&lt;\/h3>\n                                &lt;div class=\"col-md-6 col-xl-3\">\n                                @using (Html.BeginForm(\"Download\", \"SingleUseCoupon\", FormMethod.Post, new { @class = \"form-horizontal\" }))\n                                {\n                                    @Html.AntiForgeryToken()\n                                    @Html.HiddenFor(x => x.PromotionId)\n                                    &lt;button type=\"submit\" class=\"btn btn-primary\">Download&lt;\/button>\n                                }\n                                &lt;\/div>\n                                &lt;div class=\"col-md-6 col-xl-3\">\n                                @using (Html.BeginForm(\"DeleteAll\", \"SingleUseCoupon\", FormMethod.Post, new { @class = \"form-horizontal\" }))\n                                {\n                                    @Html.AntiForgeryToken()\n                                    @Html.HiddenFor(x => x.PromotionId)\n                                    &lt;button type=\"submit\" class=\"btn btn-primary\">Delete All&lt;\/button>\n                                }\n                                &lt;\/div>\n                            &lt;\/div>\n                            &lt;\/div>\n                            &lt;div class=\"mvc-grid\">\n                                @using (Html.BeginForm(\"UpdateOrDeleteCoupon\", \"SingleUseCoupon\", FormMethod.Post, new { @class = \"jsCouponUpdateForm\" }))\n                                {\n                        @Html.AntiForgeryToken()\n                                        &lt;table class=\"gift-cards-table\">\n                                            &lt;thead>\n                                                &lt;tr>\n                                                    &lt;th>Code&lt;\/th>\n                                                    &lt;th>Created&lt;\/th>\n                                                    &lt;th>Valid From&lt;\/th>\n                                                    &lt;th>Expiration&lt;\/th>\n                                                    &lt;th>Max Redemptions&lt;\/th>\n                                                    &lt;th>Used Redemptions&lt;\/th>\n                                                    &lt;th>Actions&lt;\/th>\n                                                &lt;\/tr>\n                                            &lt;\/thead>\n                                            &lt;tbody class=\"js-users-table-body\">\n                                                @for (var i = 0; i &lt; Model.Coupons.Count; i++)\n                                                {\n                                &lt;tr>\n                                    &lt;td>\n                                        @Html.HiddenFor(x => Model.Coupons&#91;i].Id)\n                                        @Html.HiddenFor(x => Model.Coupons&#91;i].PromotionId)\n                                        @Html.TextBoxFor(x => Model.Coupons&#91;i].Code, new { @class = \"form-control\" })\n                                    &lt;\/td>\n                                    &lt;td>\n                                        @Model.Coupons&#91;i].Created\n                                    &lt;\/td>\n                                    &lt;td>\n                                        @Html.TextBoxFor(x => Model.Coupons&#91;i].ValidFrom, \"{0:yyyy-MM-dd}\", new { @class = \"form-control\", @type = \"date\" })\n                                    &lt;\/td>\n                                    &lt;td>\n                                        @Html.TextBoxFor(x => Model.Coupons&#91;i].Expiration, \"{0:yyyy-MM-dd}\", new { @class = \"form-control\", @type = \"date\" })\n                                    &lt;\/td>\n                                    &lt;td>\n                                        @Html.TextBoxFor(x => Model.Coupons&#91;i].MaxRedemptions, new { @class = \"form-control\", @type = \"number\" })\n                                    &lt;\/td>\n                                    &lt;td>\n                                        @Html.TextBoxFor(x => Model.Coupons&#91;i].UsedRedemptions, new { @class = \"form-control\", @type = \"number\" })\n                                    &lt;\/td>\n                                    &lt;td style=\"text-align: right\">\n                                        &lt;i class=\"fa fa-save jsUpdateCoupon\" style=\"cursor: pointer;\" \/>\n                                        &lt;i class=\"fa fa-trash-alt jsDeleteCoupon\" style=\"cursor: pointer; color: red\">&lt;\/i>\n                                    &lt;\/td>\n\n                                &lt;\/tr>}\n                                            &lt;\/tbody>\n                                        &lt;\/table>}\n                            &lt;\/div>\n                        &lt;\/div>\n                &lt;\/div>\n            &lt;\/div>\n        &lt;\/div>\n    &lt;\/div>\n&lt;\/main>\n\n&lt;div style=\"position: fixed; top: 75px; right: 75px; display: none;\" class=\"coupon-status alert alert-info\" role=\"alert\">\n    Updating, please wait ...\n&lt;\/div>\n&lt;div style=\"position: fixed; top: 75px; right: 75px; display: none;\" class=\"coupon-alert alert\" role=\"alert\">\n&lt;\/div>\n\n@section AdditionalScripts {\n    &lt;script type=\"text\/javascript\" src=\"@Paths.ToClientResource(\"Foundation.Commerce\", \"ClientResources\/js\/Coupons.js\")\">&lt;\/script>\n    &lt;script type=\"text\/javascript\">\n        $(document).ready(function () {\n            Coupons.init();\n        });\n    &lt;\/script>\n}<\/code><\/pre>\n\n\n\n<p>Now we need to add ActionResult in SingleUseCouponController.cs controller. The process will be similar as i have described in previous blog<\/p>\n\n\n\n<pre><code>&#91;HttpPost]\n        &#91;ValidateAntiForgeryToken]\n        public ActionResult DeleteAll(PromotionCouponsViewModel model)\n        {\n            var deleted = _couponService.DeleteByPromotionId(model.PromotionId);\n            return RedirectToAction(\"EditPromotionCoupons\", new { id = model.PromotionId });\n        }<\/code><\/pre>\n\n\n\n<p>The complete manage token will look like below<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"307\" src=\"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2021\/02\/manage-coupon-codes-delete-all-1024x307.png\" loading=\"lazy\" alt=\"Manage coupon codes - Delete all coupons\" class=\"wp-image-435\" srcset=\"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2021\/02\/manage-coupon-codes-delete-all-1024x307.png 1024w, https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2021\/02\/manage-coupon-codes-delete-all-300x90.png 300w, https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2021\/02\/manage-coupon-codes-delete-all-768x230.png 768w, https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2021\/02\/manage-coupon-codes-delete-all-1536x460.png 1536w, https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2021\/02\/manage-coupon-codes-delete-all.png 1879w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Manage coupon codes &#8211; Delete all coupons<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Delete Expired coupon codes job<\/h2>\n\n\n\n<p>Once we started generating a lot of coupon codes we need a background job to clean up the mess and keep the house in order. <\/p>\n\n\n\n<p>We will write a Episerver Schedule Job that runs once a day and simply delete all expired coupon codes from database.<\/p>\n\n\n\n<p>First of all, Let&#8217;s write a new store procedure &#8220;UniqueCoupons_DeleteExpiredCoupons&#8221; in Commerce database <\/p>\n\n\n\n<pre><code>USE &#91;Epi.Foundation.Commerce]\nGO\nSET ANSI_NULLS ON\nGO\nSET QUOTED_IDENTIFIER OFF\nGO\n\nCreate PROCEDURE &#91;dbo].&#91;UniqueCoupons_DeleteExpiredCoupons]\nAS\nBEGIN\n\tDELETE FROM UniqueCoupons\n\tWHERE Expiration &lt; GETDATE()\nEND\n<\/code><\/pre>\n\n\n\n<p>The next step is to create a new method in Unique Coupon Service. The schedule job calls the Delete Expired Coupons method to delete all expired coupon codes.<\/p>\n\n\n\n<pre><code>        public bool DeleteExpiredCoupons()\n        {\n            try\n            {\n                var connectionString = _connectionHandler.Commerce.ConnectionString;\n                using (var connection = new SqlConnection(connectionString))\n                {\n                    connection.Open();\n                    using (var transaction = connection.BeginTransaction())\n                    {\n                        var command = new SqlCommand\n                        {\n                            Connection = transaction.Connection,\n                            Transaction = transaction,\n                            CommandType = CommandType.StoredProcedure,\n                            CommandText = \"UniqueCoupons_DeleteExpiredCoupons\"\n                        };\n                        \n                        command.ExecuteNonQuery();\n                        transaction.Commit();\n                    }\n                }\n\n                return true;\n            }\n            catch (Exception exn)\n            {\n                _logger.Error(exn.Message, exn);\n            }\n\n            return false;\n        }<\/code><\/pre>\n\n\n\n<p>Now let&#8217;s create a schedule job. <\/p>\n\n\n\n<pre><code>using EPiServer.PlugIn;\nusing EPiServer.Scheduler;\nusing Foundation.Commerce.Marketing;\n\nnamespace Foundation.Infrastructure.Jobs\n{\n    &#91;ScheduledPlugIn(DisplayName = \"Delete expired coupon job.\", GUID = \"E665179B-E188-4D1B-919A-183EC5456309\")]\n    public class DeleteExpiredCouponJob : ScheduledJobBase\n    {\n        private bool _stopSignaled;\n        private readonly UniqueCouponService _couponService;\n\n        public DeleteExpiredCouponJob(UniqueCouponService couponService)\n        {\n            IsStoppable = true;\n            _couponService = couponService;\n        }\n\n        public override void Stop() => _stopSignaled = true;\n        \n        public override string Execute()\n        {\n            OnStatusChanged(string.Format(\"Starting execution of {0}\", GetType()));\n\n            var result =_couponService.DeleteExpiredCoupons();\n\n            if (_stopSignaled)\n            {\n                return \"Stop of job was called\";\n            }\n\n            if (result)\n            {\n                return \"Job runs sucessfully\";\n            }\n            else\n            {\n                return \"There is problem with job execution\";\n            }\n\n            \n        }\n    }\n}\n<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This blog is the second part of Episerver Coupon codes Tool: Download single-use coupons. Let&#8217;s further extend the Coupon codes tool. Once the website starts&#8230;<\/p>\n","protected":false},"author":1,"featured_media":65,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[13,22,61],"class_list":["post-415","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-episerver","tag-episerver","tag-episerver-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 Tool: Delete expired \/ unused coupons<\/title>\n<meta name=\"description\" content=\"Episerver Coupon codes Tool: Delete expired \/ unused coupons - 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-delete-expired-unused-coupons\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Episerver Coupon codes Tool: Delete expired \/ unused coupons\" \/>\n<meta property=\"og:description\" content=\"Episerver Coupon codes Tool: Delete expired \/ unused coupons - AI, Optimizely, Azure &amp; more\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.naveedulhaq.com\/index.php\/episerver\/episerver-coupon-codes-tool-delete-expired-unused-coupons\/\" \/>\n<meta property=\"og:site_name\" content=\"Naveed Ul-Haq&#039;s blog\" \/>\n<meta property=\"article:published_time\" content=\"2021-02-20T21:33:31+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-02-20T21:33:33+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2020\/01\/episerver.jpeg\" \/>\n\t<meta property=\"og:image:width\" content=\"230\" \/>\n\t<meta property=\"og:image:height\" content=\"230\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\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=\"5 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-delete-expired-unused-coupons\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/episerver\\\/episerver-coupon-codes-tool-delete-expired-unused-coupons\\\/\"},\"author\":{\"name\":\"Naveed Ul-Haq\",\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/#\\\/schema\\\/person\\\/dd6db5980b965fcae41e096d357c65c9\"},\"headline\":\"Episerver Coupon codes Tool: Delete expired \\\/ unused coupons\",\"datePublished\":\"2021-02-20T21:33:31+00:00\",\"dateModified\":\"2021-02-20T21:33:33+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/episerver\\\/episerver-coupon-codes-tool-delete-expired-unused-coupons\\\/\"},\"wordCount\":337,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/#\\\/schema\\\/person\\\/dd6db5980b965fcae41e096d357c65c9\"},\"image\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/episerver\\\/episerver-coupon-codes-tool-delete-expired-unused-coupons\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.naveedulhaq.com\\\/wp-content\\\/uploads\\\/2020\\\/01\\\/episerver.jpeg\",\"keywords\":[\"episerver\",\"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-delete-expired-unused-coupons\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/episerver\\\/episerver-coupon-codes-tool-delete-expired-unused-coupons\\\/\",\"url\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/episerver\\\/episerver-coupon-codes-tool-delete-expired-unused-coupons\\\/\",\"name\":\"Episerver Coupon codes Tool: Delete expired \\\/ unused coupons\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/episerver\\\/episerver-coupon-codes-tool-delete-expired-unused-coupons\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/episerver\\\/episerver-coupon-codes-tool-delete-expired-unused-coupons\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.naveedulhaq.com\\\/wp-content\\\/uploads\\\/2020\\\/01\\\/episerver.jpeg\",\"datePublished\":\"2021-02-20T21:33:31+00:00\",\"dateModified\":\"2021-02-20T21:33:33+00:00\",\"description\":\"Episerver Coupon codes Tool: Delete expired \\\/ unused coupons - AI, Optimizely, Azure &amp; more\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/episerver\\\/episerver-coupon-codes-tool-delete-expired-unused-coupons\\\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/episerver\\\/episerver-coupon-codes-tool-delete-expired-unused-coupons\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/episerver\\\/episerver-coupon-codes-tool-delete-expired-unused-coupons\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.naveedulhaq.com\\\/wp-content\\\/uploads\\\/2020\\\/01\\\/episerver.jpeg\",\"contentUrl\":\"https:\\\/\\\/www.naveedulhaq.com\\\/wp-content\\\/uploads\\\/2020\\\/01\\\/episerver.jpeg\",\"width\":230,\"height\":230,\"caption\":\"episerver\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/episerver\\\/episerver-coupon-codes-tool-delete-expired-unused-coupons\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.naveedulhaq.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Episerver Coupon codes Tool: Delete expired \\\/ unused coupons\"}]},{\"@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 Tool: Delete expired \/ unused coupons","description":"Episerver Coupon codes Tool: Delete expired \/ unused coupons - 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-delete-expired-unused-coupons\/","og_locale":"en_GB","og_type":"article","og_title":"Episerver Coupon codes Tool: Delete expired \/ unused coupons","og_description":"Episerver Coupon codes Tool: Delete expired \/ unused coupons - AI, Optimizely, Azure &amp; more","og_url":"https:\/\/www.naveedulhaq.com\/index.php\/episerver\/episerver-coupon-codes-tool-delete-expired-unused-coupons\/","og_site_name":"Naveed Ul-Haq&#039;s blog","article_published_time":"2021-02-20T21:33:31+00:00","article_modified_time":"2021-02-20T21:33:33+00:00","og_image":[{"width":230,"height":230,"url":"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2020\/01\/episerver.jpeg","type":"image\/jpeg"}],"author":"Naveed Ul-Haq","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Naveed Ul-Haq","Estimated reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.naveedulhaq.com\/index.php\/episerver\/episerver-coupon-codes-tool-delete-expired-unused-coupons\/#article","isPartOf":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/episerver\/episerver-coupon-codes-tool-delete-expired-unused-coupons\/"},"author":{"name":"Naveed Ul-Haq","@id":"https:\/\/www.naveedulhaq.com\/#\/schema\/person\/dd6db5980b965fcae41e096d357c65c9"},"headline":"Episerver Coupon codes Tool: Delete expired \/ unused coupons","datePublished":"2021-02-20T21:33:31+00:00","dateModified":"2021-02-20T21:33:33+00:00","mainEntityOfPage":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/episerver\/episerver-coupon-codes-tool-delete-expired-unused-coupons\/"},"wordCount":337,"commentCount":0,"publisher":{"@id":"https:\/\/www.naveedulhaq.com\/#\/schema\/person\/dd6db5980b965fcae41e096d357c65c9"},"image":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/episerver\/episerver-coupon-codes-tool-delete-expired-unused-coupons\/#primaryimage"},"thumbnailUrl":"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2020\/01\/episerver.jpeg","keywords":["episerver","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-delete-expired-unused-coupons\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.naveedulhaq.com\/index.php\/episerver\/episerver-coupon-codes-tool-delete-expired-unused-coupons\/","url":"https:\/\/www.naveedulhaq.com\/index.php\/episerver\/episerver-coupon-codes-tool-delete-expired-unused-coupons\/","name":"Episerver Coupon codes Tool: Delete expired \/ unused coupons","isPartOf":{"@id":"https:\/\/www.naveedulhaq.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/episerver\/episerver-coupon-codes-tool-delete-expired-unused-coupons\/#primaryimage"},"image":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/episerver\/episerver-coupon-codes-tool-delete-expired-unused-coupons\/#primaryimage"},"thumbnailUrl":"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2020\/01\/episerver.jpeg","datePublished":"2021-02-20T21:33:31+00:00","dateModified":"2021-02-20T21:33:33+00:00","description":"Episerver Coupon codes Tool: Delete expired \/ unused coupons - AI, Optimizely, Azure &amp; more","breadcrumb":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/episerver\/episerver-coupon-codes-tool-delete-expired-unused-coupons\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.naveedulhaq.com\/index.php\/episerver\/episerver-coupon-codes-tool-delete-expired-unused-coupons\/"]}]},{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.naveedulhaq.com\/index.php\/episerver\/episerver-coupon-codes-tool-delete-expired-unused-coupons\/#primaryimage","url":"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2020\/01\/episerver.jpeg","contentUrl":"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2020\/01\/episerver.jpeg","width":230,"height":230,"caption":"episerver"},{"@type":"BreadcrumbList","@id":"https:\/\/www.naveedulhaq.com\/index.php\/episerver\/episerver-coupon-codes-tool-delete-expired-unused-coupons\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.naveedulhaq.com\/"},{"@type":"ListItem","position":2,"name":"Episerver Coupon codes Tool: Delete expired \/ unused coupons"}]},{"@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\/415","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=415"}],"version-history":[{"count":0,"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/posts\/415\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/media\/65"}],"wp:attachment":[{"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/media?parent=415"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/categories?post=415"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/tags?post=415"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}