Php WooCommerce电子邮件作者发帖确认不起作用
我正在使用WooCommerce可预订产品扩展,并已将其设置为将预订通过电子邮件发送给管理员进行确认-我正在尝试使用新的预订类文件连接到该扩展,以便它通过电子邮件发送帖子作者而不是管理员-但这似乎不起作用 这是我的密码:Php WooCommerce电子邮件作者发帖确认不起作用,php,wordpress,woocommerce,Php,Wordpress,Woocommerce,我正在使用WooCommerce可预订产品扩展,并已将其设置为将预订通过电子邮件发送给管理员进行确认-我正在尝试使用新的预订类文件连接到该扩展,以便它通过电子邮件发送帖子作者而不是管理员-但这似乎不起作用 这是我的密码: $productTitle = $this->object->get_product()->get_title(); $theProdID = get_page_by_title( $productTitle, 'object', 'prod
$productTitle = $this->object->get_product()->get_title();
$theProdID = get_page_by_title( $productTitle, 'object', 'product' );
$post = get_post( $post = $theProdID, $output = OBJECT, $filter = 'raw' );
$author_id = $post->post_author;
$emailToSend = get_the_author_meta( 'user_email', $author_id );
$this->send( $emailToSend, $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
我将完整的类文件放在这里您测试过$author_id和$emailToSend都有预期值吗?@Kkinsey我没有,您能建议测试这些值的最佳方法吗?如果合适的话,将值回显到屏幕上,或者将它们写入运行脚本后可以阅读的文件中,或者将它们发送给您自己,尽管,因为我们正在调试邮件呼叫,这可能不是最好的策略$author\u id=$post->post\u author;file\u put\u contents/tmp/mydebug.txt,作者ID:$author\u ID,file\u APPEND;