{"id":1181964,"date":"2016-10-24T09:24:38","date_gmt":"2016-10-24T16:24:38","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/get-all-attendees-email-address\/"},"modified":"2016-10-24T09:24:38","modified_gmt":"2016-10-24T16:24:38","slug":"get-all-attendees-email-address","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/get-all-attendees-email-address\/","title":{"rendered":"Get All Attendee&#039;s Email Address"},"content":{"rendered":"<p>Currently I have A mutli-Ticket event where each Ticket Obtains the Ticket holder&#8217;s Info such as Name and Email, I pre-populate The Ticket info for Member Only Tickets, and Guest tickets just fills out the info themselves.<\/p>\n<p>I attached a filter to the CSV Export function <strong>tribe_events_tickets_attendees_csv_items<\/strong><\/p>\n<p>with a New array that looks like this<br \/>\n<strong>$newarray = array( array(&#8216;Ticket #&#8217;, &#8216;Ticket&#8217;,&#8217;First Name&#8217;, &#8216;Last Name&#8217;, &#8216;Email Address&#8217;, &#8216;Organization Name&#8217;, &#8216;Order ID&#8217;, &#8216;Order Status&#8217;, &#8216;Customer Name&#8217;, &#8216;Customer Email Address&#8217;) );<\/strong><\/p>\n<p>I now Need to read this output on the fronted&#8217;s search member as you type function to filter out the members who have already brought a ticket.<\/p>\n<p>which contains a User search query with the current Event_ID passed to the function.<\/p>\n<p>with a loop output function :<br \/>\n<strong>echo $user-&gt;first_name . &#8216; &#8216; . $user-&gt;last_name  . $user_org . &#8220;&lt;span style=&#8217;display:none;&#8217;&gt; | &#8220;. $user-&gt;user_email.&#8221;&lt;\/span&gt;\\n&#8221;;<\/strong><\/p>\n<p>I searched for the core function and found the following<br \/>\n<strong>Tribe__Tickets__Tickets_Handler.php -&gt; generate_filtered_attendees_list( $eventid );<\/strong><\/p>\n<p>which calls the filter at the very end and applies it, but I cannot use this since it is a private function.<br \/>\nHow can I get the current Attendee&#8217;s Email Address?<\/p>\n<p>Below is my user output function.<\/p>\n<pre><code>function se_lookup() {\n    global $wpdb;\n\n    $search = sanitize_text_field($_REQUEST[&#039;q&#039;]);\n    $eventid = sanitize_text_field($_REQUEST[&#039;id&#039;]);\n\t\/\/$method = new ReflectionMethod( &#039;Tribe__Tickets__Tickets_Handler&#039;, &#039;generate_filtered_attendees_list&#039;);\n\t\/\/$method-&gt;setAccessible(true);\n\t\/\/echo $method-&gt;invoke( new Tribe__Tickets__Tickets_Handler(), $eventid);\n\t\n\t\n    $args = array(\n\t\t&#039;search&#039; =&gt; &#039;*&#039;. $search .&#039;*&#039;\n\t);\n\t$wp_user_query  = new WP_User_Query( $args );\n\t$users = $wp_user_query-&gt;get_results();\n\t\tforeach ($users as $user) {\n\t\t\tif (wc_memberships_is_user_active_member($user-&gt;ID, &#039;member&#039;)){\n\t\t\t\tif (get_user_meta($user-&gt;ID, &#039;directory_company_name&#039;, true)){\n\t\t\t\t\t$user_org = &#039; | &#039; . get_user_meta($user-&gt;ID, &#039;directory_company_name&#039;, true);\n\t\t\t\t} else { $user_org = &quot; | N\/A&quot;; }\n\t\t\t\techo $user-&gt;first_name . &#039; &#039; . $user-&gt;last_name  . $user_org . &quot;&lt;span style=&#039;display:none;&#039;&gt; | &quot;. $user-&gt;user_email.&quot;&lt;\/span&gt;\\n&quot;;\n\t\t\t}\n\t\t}\n    die();\n}<\/code><\/pre>\n","protected":false},"template":"","class_list":["post-1181964","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>Get All Attendee&#039;s Email Address -<\/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\/get-all-attendees-email-address\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Get All Attendee&#039;s Email Address -\" \/>\n<meta property=\"og:description\" content=\"Currently I have A mutli-Ticket event where each Ticket Obtains the Ticket holder&#8217;s Info such as Name and Email, I pre-populate The Ticket info for Member Only Tickets, and Guest tickets just fills out the info themselves. I attached a filter to the CSV Export function tribe_events_tickets_attendees_csv_items with a New array that looks like this [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/get-all-attendees-email-address\/\" \/>\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=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/get-all-attendees-email-address\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/get-all-attendees-email-address\/\",\"name\":\"Get All Attendee&#039;s Email Address -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2016-10-24T16:24:38+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/get-all-attendees-email-address\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/get-all-attendees-email-address\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/get-all-attendees-email-address\/#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\":\"Get All Attendee&#039;s Email Address\"}]},{\"@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":"Get All Attendee&#039;s Email Address -","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\/get-all-attendees-email-address\/","og_locale":"en_US","og_type":"article","og_title":"Get All Attendee&#039;s Email Address -","og_description":"Currently I have A mutli-Ticket event where each Ticket Obtains the Ticket holder&#8217;s Info such as Name and Email, I pre-populate The Ticket info for Member Only Tickets, and Guest tickets just fills out the info themselves. I attached a filter to the CSV Export function tribe_events_tickets_attendees_csv_items with a New array that looks like this [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/get-all-attendees-email-address\/","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/get-all-attendees-email-address\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/get-all-attendees-email-address\/","name":"Get All Attendee&#039;s Email Address -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2016-10-24T16:24:38+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/get-all-attendees-email-address\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/get-all-attendees-email-address\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/get-all-attendees-email-address\/#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":"Get All Attendee&#039;s Email Address"}]},{"@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\/1181964","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\/1181964\/revisions"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1181964"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}