{"id":1166965,"date":"2016-09-21T09:25:37","date_gmt":"2016-09-21T16:25:37","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/adding-custom-field-to-email-php-on-event-tickets\/"},"modified":"2016-09-21T09:25:37","modified_gmt":"2016-09-21T16:25:37","slug":"adding-custom-field-to-email-php-on-event-tickets","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/adding-custom-field-to-email-php-on-event-tickets\/","title":{"rendered":"Adding custom field to email.php on Event Tickets"},"content":{"rendered":"<p>This is an update to this ticket:  https:\/\/theeventscalendar.com\/support\/forums\/topic\/acf-display-in-email-template\/#post-1152062<\/p>\n<p>Aim:  Add a custom field with the registration URL of the event into the Ticket Email. <\/p>\n<p>Here is the code:<\/p>\n<pre><code>&lt;h2&gt;Webinar Details:&lt;\/h2&gt;\t\t\t\t\t\t\t\t\t\t\n    &lt;?php\n         $webinarURL = get_field( &#039;webinarLink&#039; );\n         if( $webinarURL ) {\n             echo &#039;&lt;a href=&quot;&#039; . $webinarURL . &#039;&quot; target=&quot;_blank&quot;&gt;WEBINAR REGISTRATION&lt;\/a&gt;&#039;;\n         } else {\n             echo &#039;empty&#039;;\n         }\n    ?&gt;<\/code><\/pre>\n<p>This works for projects but when I try to implement it on the following template: \/plugins\/event-tickets\/src\/views\/event-tickets\/tickets\/email.php  I am constantly getting:<\/p>\n<p>Webinar Details<br \/>\nEmpty<\/p>\n<p>The webinarLink field is definitely filled in with the same url on both the project page and the event page. <\/p>\n<p>I know Geoff was able to get it working on his end &#8211; I am mystified as to why I cannot get it working.  It just doesn&#8217;t seem to be able to pick up the custom field but the if statement is working.  <\/p>\n<p>Do you have any idea why this is happening?<\/p>\n<p>Kind Regards,<br \/>\nOrla<\/p>\n","protected":false},"template":"","class_list":["post-1166965","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>Adding custom field to email.php on Event Tickets -<\/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\/adding-custom-field-to-email-php-on-event-tickets\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Adding custom field to email.php on Event Tickets -\" \/>\n<meta property=\"og:description\" content=\"This is an update to this ticket: https:\/\/theeventscalendar.com\/support\/forums\/topic\/acf-display-in-email-template\/#post-1152062 Aim: Add a custom field with the registration URL of the event into the Ticket Email. Here is the code: &lt;h2&gt;Webinar Details:&lt;\/h2&gt; &lt;?php $webinarURL = get_field( &#039;webinarLink&#039; ); if( $webinarURL ) { echo &#039;&lt;a href=&quot;&#039; . $webinarURL . &#039;&quot; target=&quot;_blank&quot;&gt;WEBINAR REGISTRATION&lt;\/a&gt;&#039;; } else { echo &#039;empty&#039;; } [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/adding-custom-field-to-email-php-on-event-tickets\/\" \/>\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\/adding-custom-field-to-email-php-on-event-tickets\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/adding-custom-field-to-email-php-on-event-tickets\/\",\"name\":\"Adding custom field to email.php on Event Tickets -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2016-09-21T16:25:37+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/adding-custom-field-to-email-php-on-event-tickets\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/adding-custom-field-to-email-php-on-event-tickets\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/adding-custom-field-to-email-php-on-event-tickets\/#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\":\"Adding custom field to email.php on Event Tickets\"}]},{\"@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":"Adding custom field to email.php on Event Tickets -","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\/adding-custom-field-to-email-php-on-event-tickets\/","og_locale":"en_US","og_type":"article","og_title":"Adding custom field to email.php on Event Tickets -","og_description":"This is an update to this ticket: https:\/\/theeventscalendar.com\/support\/forums\/topic\/acf-display-in-email-template\/#post-1152062 Aim: Add a custom field with the registration URL of the event into the Ticket Email. Here is the code: &lt;h2&gt;Webinar Details:&lt;\/h2&gt; &lt;?php $webinarURL = get_field( &#039;webinarLink&#039; ); if( $webinarURL ) { echo &#039;&lt;a href=&quot;&#039; . $webinarURL . &#039;&quot; target=&quot;_blank&quot;&gt;WEBINAR REGISTRATION&lt;\/a&gt;&#039;; } else { echo &#039;empty&#039;; } [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/adding-custom-field-to-email-php-on-event-tickets\/","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\/adding-custom-field-to-email-php-on-event-tickets\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/adding-custom-field-to-email-php-on-event-tickets\/","name":"Adding custom field to email.php on Event Tickets -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2016-09-21T16:25:37+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/adding-custom-field-to-email-php-on-event-tickets\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/adding-custom-field-to-email-php-on-event-tickets\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/adding-custom-field-to-email-php-on-event-tickets\/#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":"Adding custom field to email.php on Event Tickets"}]},{"@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\/1166965","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":0,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1166965\/revisions"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1166965"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}