{"id":1096835,"date":"2016-04-01T03:16:34","date_gmt":"2016-04-01T10:16:34","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/ticket-email-sends-depending\/"},"modified":"2016-04-16T09:35:02","modified_gmt":"2016-04-16T16:35:02","slug":"ticket-email-sends-depending","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/ticket-email-sends-depending\/","title":{"rendered":"Ticket email sends depending"},"content":{"rendered":"<p>Hi,<\/p>\n<p>My client wants customers to chose between virtual and physical tickets. To achieve this I&#8217;ve forced all tickets to not to be virtual products so that I can have shipping options. I&#8217;ve done this by using the following code:<\/p>\n<pre><code>\/**\n* Stop tickets being virtual\n*\/\nfunction make_ticket_physical($post_ID, $post_after, $post_before){\n    if($post_after-&gt;post_type == &#039;product&#039;){\n        update_post_meta( $post_ID, &#039;_virtual&#039;, &#039;no&#039;);\n    }\n}\n \nadd_action( &#039;save_post&#039;, &#039;make_ticket_physical&#039;, 999999999999999999999, 3 );<\/code><\/pre>\n<p>But now I want to be able to stop the ticket email being sent if they selected to have a physical ticket. Can you point me in the direction of where the code that fires the email being sent is? I&#8217;m hoping I can hook into the order details and stop it sending if necessary. <\/p>\n<p>Thanks,<br \/>\nJames.<\/p>\n","protected":false},"template":"","class_list":["post-1096835","topic","type-topic","status-closed","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Ticket email sends depending -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/ticket-email-sends-depending\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Ticket email sends depending -\" \/>\n<meta property=\"og:description\" content=\"Hi, My client wants customers to chose between virtual and physical tickets. To achieve this I&#8217;ve forced all tickets to not to be virtual products so that I can have shipping options. I&#8217;ve done this by using the following code: \/** * Stop tickets being virtual *\/ function make_ticket_physical($post_ID, $post_after, $post_before){ if($post_after-&gt;post_type == &#039;product&#039;){ update_post_meta( [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/ticket-email-sends-depending\/\" \/>\n<meta property=\"article:modified_time\" content=\"2016-04-16T16:35:02+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/ticket-email-sends-depending\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/ticket-email-sends-depending\/\",\"name\":\"Ticket email sends depending -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2016-04-01T10:16:34+00:00\",\"dateModified\":\"2016-04-16T16:35:02+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/ticket-email-sends-depending\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/ticket-email-sends-depending\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/ticket-email-sends-depending\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/theeventscalendar.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\/\/theeventscalendar.com\/support\/topics\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Ticket Products\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/event-tickets\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Event Tickets Plus\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/event-tickets\/event-tickets-plus\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Ticket email sends depending\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\",\"url\":\"https:\/\/theeventscalendar.com\/support\/\",\"name\":\"\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Ticket email sends depending -","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:\/\/theeventscalendar.com\/support\/forums\/topic\/ticket-email-sends-depending\/","og_locale":"en_US","og_type":"article","og_title":"Ticket email sends depending -","og_description":"Hi, My client wants customers to chose between virtual and physical tickets. To achieve this I&#8217;ve forced all tickets to not to be virtual products so that I can have shipping options. I&#8217;ve done this by using the following code: \/** * Stop tickets being virtual *\/ function make_ticket_physical($post_ID, $post_after, $post_before){ if($post_after-&gt;post_type == &#039;product&#039;){ update_post_meta( [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/ticket-email-sends-depending\/","article_modified_time":"2016-04-16T16:35:02+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/ticket-email-sends-depending\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/ticket-email-sends-depending\/","name":"Ticket email sends depending -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2016-04-01T10:16:34+00:00","dateModified":"2016-04-16T16:35:02+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/ticket-email-sends-depending\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/ticket-email-sends-depending\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/ticket-email-sends-depending\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/theeventscalendar.com\/support\/"},{"@type":"ListItem","position":2,"name":"Topics","item":"https:\/\/theeventscalendar.com\/support\/topics\/"},{"@type":"ListItem","position":3,"name":"Ticket Products","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/event-tickets\/"},{"@type":"ListItem","position":4,"name":"Event Tickets Plus","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/event-tickets\/event-tickets-plus\/"},{"@type":"ListItem","position":5,"name":"Ticket email sends depending"}]},{"@type":"WebSite","@id":"https:\/\/theeventscalendar.com\/support\/#website","url":"https:\/\/theeventscalendar.com\/support\/","name":"","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1096835","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":1,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1096835\/revisions"}],"predecessor-version":[{"id":1096854,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1096835\/revisions\/1096854"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1096835"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}