{"id":1958369,"date":"2023-11-01T18:07:24","date_gmt":"2023-11-01T22:07:24","guid":{"rendered":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/?p=1958369"},"modified":"2024-12-19T06:11:46","modified_gmt":"2024-12-19T11:11:46","slug":"add-custom-bcc-emails-to-the-rsvp-email","status":"publish","type":"post","link":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/add-custom-bcc-emails-to-the-rsvp-email\/","title":{"rendered":"Add custom BCC emails to the RSVP Email"},"content":{"rendered":"\n<p class=\"has-background\" style=\"background-color:var(--global-palette8)\"><strong>\u26a0\ufe0f<\/strong> <strong>Note:<\/strong> These snippets won\u2019t work if RSVP emails are configured to use the Ticket email template. Disable the\u00a0<strong>Use Ticket Email\u00a0<\/strong><a href=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2024\/04\/et_rsvp_email_settings.jpg\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">option<\/a> under\u00a0<strong>Tickets > Settings > Emails > RSVP Email<\/strong>.<\/p>\n\n\n\n<p>By default, registrants will receive an email including their RSVP info upon registration. The site administrator or the organizer does not get any kind of notification. This can be achieved, however, with one of the below snippets.<\/p>\n\n\n\n<p>Add the code snippet to the <em>functions.php<\/em> file of your theme, or use your preferred method for integrating snippets into your WordPress site, such as the free <a href=\"https:\/\/wordpress.org\/plugins\/code-snippets\/\" target=\"_blank\" rel=\"noreferrer noopener\">Code Snippets<\/a> plugin.<\/p>\n\n\n\n<p>With this simple snippet, you can add any email address to the BCC field of the email.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n&lt;?php\n\/\/* Do NOT include the opening php tag, if there&#039;s already one.\n\n\/**\n* Add a custom email address to the BCC field on all Event Tickets&#039; RSVP ticket emails\n*\/\nadd_filter( &#039;tec_tickets_emails_dispatcher_rsvp_headers&#039;, &#039;my_add_bcc_email_headers&#039; );\n\nfunction my_add_bcc_email_headers( $headers ) {\n\n\t$headers&#x5B;&#039;Bcc&#039;] = &#039;YOUR NAME &lt;your@email.com&gt;&#039;;\n\t\n\treturn $headers;\n}\n<\/pre><\/div>\n\n\n<p>To add event organizers to the BBC for the RSVP Email you can use this modified version.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n&lt;?php\n\/\/* Do NOT include the opening php tag, if there&#039;s already one.\n\n\/**\n * Add the event organizer to the BCC field on the Event Tickets&#039; RSVP ticket emails.\n *\/\nadd_filter( &#039;tec_tickets_emails_dispatcher_rsvp_headers&#039;, &#039;my_add_bcc_email_organizers_headers&#039;, 10, 2 );\n\nfunction my_add_bcc_email_organizers_headers( $headers, $dispatcher ) {\n\t$email   = $dispatcher-&gt;get_email();\n\t$post_id = $email-&gt;get( &#039;post_id&#039; );\n\n\tif ( ! $post_id || ! function_exists( &#039;tribe_get_event&#039; ) )  {\n\t\treturn $headers;\n\t}\n\n\t$event = tribe_get_event( $post_id );\n\n\tif ( empty( $event ) ) {\n\t\treturn $headers;\n\t}\n\n\t\/\/ Bail, if there&#039;s no organizer set.\n\tif ( ! tribe_has_organizer( $post_id ) ) {\n\t\treturn $headers;\n\t}\n\n\t\/\/ Get the organizers.\n\t$organizers = tribe_get_organizer_ids( $post_id );\n\n\t\/\/ Loop through the organizers.\n\tforeach ( $organizers as $organizer_id ) {\n\t\t\/\/ Get the organizer email address.\n\t\t$organizer_email = stripslashes_deep( html_entity_decode( tribe_get_organizer_email( $organizer_id ), ENT_COMPAT, &#039;UTF-8&#039; ) );\n\n\t\t\/\/ Add the organizer email info to our emails array.\n\t\t$emails&#x5B;] = $organizer_email;\n\t}\n\n\t\/\/ Bail, if there are no organizer email addresses.\n\tif ( empty( $emails ) ) {\n\t\treturn $headers;\n\t}\n\n\t\/\/ List the email addresses and add them to the BCC field.\n\t$headers&#x5B;&#039;Bcc&#039;] = implode( &quot;,&quot;, $emails );\n\n\treturn $headers;\n}\n<\/pre><\/div>\n\n\n<p>The above snippets are for the RSVP ticket emails specifically. To do something similar for other (RSVP and Tickets Commerce) emails you need to use the appropriate version of the <code>tec_tickets_emails_dispatcher_{$email_slug}_headers<\/code> filter, where the <code>$email_slug<\/code> can have the following values:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>rsvp<\/li>\n\n\n\n<li>rsvp-not-going<\/li>\n\n\n\n<li>ticket<\/li>\n\n\n\n<li>completed-order<\/li>\n\n\n\n<li>purchase-receipt<\/li>\n<\/ul>\n\n\n\n<p>So, for example, for the purchase receipt email, the filter name would be <code>tec_tickets_emails_dispatcher_purchase-receipt_headers<\/code>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u26a0\ufe0f Note: These snippets won\u2019t work if RSVP emails are configured to use the Ticket email template. Disable the\u00a0Use Ticket Email\u00a0option under\u00a0Tickets > Settings > Emails > RSVP Email. By default, registrants will receive an email including their RSVP info upon registration. The site administrator or the organizer does not get any kind of notification&#8230;.<\/p>\n","protected":false},"author":17,"featured_media":1955565,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_swpsp_post_exclude":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"ep_exclude_from_search":false,"footnotes":""},"categories":[24,59,79],"tags":[28,73,89],"stellar-product-taxonomy":[155,156],"class_list":["post-1958369","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-customizing","category-customizing-resources","category-snippets","tag-email","tag-rsvp","tag-tickets-commerce","stellar-product-taxonomy-event-tickets","stellar-product-taxonomy-event-tickets-plus"],"acf":[],"taxonomy_info":{"category":[{"value":24,"label":"Customizations"},{"value":59,"label":"PHP &amp; Functions"},{"value":79,"label":"Snippets"}],"post_tag":[{"value":28,"label":"Email"},{"value":73,"label":"rsvp"},{"value":89,"label":"Tickets Commerce"}],"stellar-product-taxonomy":[{"value":155,"label":"Event Tickets"},{"value":156,"label":"Event Tickets Plus"}]},"featured_image_src_large":["https:\/\/images.theeventscalendar.com\/kb\/uploads\/2023\/02\/social-share-1024x538.png",1024,538,true],"author_info":{"display_name":"Andras Guseo","author_link":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/author\/andras\/"},"comment_info":0,"category_info":[{"term_id":24,"name":"Customizations","slug":"customizing","term_group":0,"term_taxonomy_id":24,"taxonomy":"category","description":"","parent":0,"count":110,"filter":"raw","term_order":"0","cat_ID":24,"category_count":110,"category_description":"","cat_name":"Customizations","category_nicename":"customizing","category_parent":0},{"term_id":59,"name":"PHP &amp; Functions","slug":"customizing-resources","term_group":0,"term_taxonomy_id":59,"taxonomy":"category","description":"","parent":24,"count":101,"filter":"raw","term_order":"0","cat_ID":59,"category_count":101,"category_description":"","cat_name":"PHP &amp; Functions","category_nicename":"customizing-resources","category_parent":24},{"term_id":79,"name":"Snippets","slug":"snippets","term_group":0,"term_taxonomy_id":79,"taxonomy":"category","description":"","parent":0,"count":136,"filter":"raw","term_order":"0","cat_ID":79,"category_count":136,"category_description":"","cat_name":"Snippets","category_nicename":"snippets","category_parent":0}],"tag_info":[{"term_id":28,"name":"Email","slug":"email","term_group":0,"term_taxonomy_id":28,"taxonomy":"post_tag","description":"","parent":0,"count":20,"filter":"raw","term_order":"0"},{"term_id":73,"name":"rsvp","slug":"rsvp","term_group":0,"term_taxonomy_id":73,"taxonomy":"post_tag","description":"","parent":0,"count":7,"filter":"raw","term_order":"0"},{"term_id":89,"name":"Tickets Commerce","slug":"tickets-commerce","term_group":0,"term_taxonomy_id":89,"taxonomy":"post_tag","description":"","parent":26,"count":26,"filter":"raw","term_order":"0"}],"_links":{"self":[{"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1958369","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/users\/17"}],"replies":[{"embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/comments?post=1958369"}],"version-history":[{"count":4,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1958369\/revisions"}],"predecessor-version":[{"id":1959788,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1958369\/revisions\/1959788"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/media\/1955565"}],"wp:attachment":[{"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/media?parent=1958369"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=1958369"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=1958369"},{"taxonomy":"stellar-product-taxonomy","embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/stellar-product-taxonomy?post=1958369"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}