输出逗号分隔的 ACF 转发器子字段值列表

Output comma separated list of ACF repeater sub field values

我有一个用于电子邮件地址的 ACF 转发器字段 field_5f71d4eaaf381,我想输出一个逗号分隔的子字段值列表 (measurement_extra_email_address) 以创建一个 $to WordPress 邮件功能。

            $values           = $_POST['acf'];
            $extra_recipients = $_POST['acf']['field_5f71d4eaaf381'];

            if ( $extra_recipients ) {
                $list = array();
                foreach( $extra_recipients as $extra_recipient ) {
                    $list[] = $extra_recipient['measurement_extra_email_address'];
                }
                $to = implode(',', $list);
            }

我认为上面的代码 should/would 可以执行但没有发送电子邮件所以我猜代码不正确..?

请注意:当我删除上面的部分代码并尝试 $to = 'my@emailadress.com'; 正在发送电子邮件时,错误应该在那里...

这是我要找的代码:

            $values = $_POST['acf'];
            $measurement_mail_extra_recipients = $_POST['acf']['field_5f71d4eaaf381'];

            if ( $measurement_mail_extra_recipients ) {
                $list = array();
                foreach( $measurement_mail_extra_recipients as $measurement_mail_extra_recipient ) {
                    $list[] = $measurement_mail_extra_recipient['field_5f71d55aaf382', $measurement_client];
                }
                $to = implode(',', $list);
            }