Skip to content
Advertisement

Adding BCC recipient to WooCommerce email notification from ACF option

Using Advanced Custom Fields plugin, I have created a custom field in the WordPress options tab that allows my client to add an additional email which will receive Woocommerce new order email confirmation, as well as themselves.

The function below is working if i hardcode the email address. Although i want the additional email recipient to pull from the ACF options which the client can add/change etc. The email is pulling through correctly from options ACF. Although when i try to concatenate the email to the BCC the new email doesn’t receive the new order email.

Can anyone point out where im going wrong with this please? Thanks

JavaScript

Advertisement

Answer

There are some mistakes in your code… You need to check that you get a value when using your ACF custom field: get_field( 'manufacturer_email_recipient', 'options' ).

If its is the case, try the following:

JavaScript

Code goes in functions.php file of the active child theme (or active theme). It should work.

Related: New Account Email Notification sent to Admin as BCC in Woocommerce

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement