我试图调整https://www.skyverge.com/blog/how-to-add-a-custom-woocommerce-email/上的自定义电子邮件插件
我的意图是,如果客户选择具有特定属性的产品(它是可变产品),则当客户进行新订单时必须发送自定义电子邮件(必须将其发送为待处理或处理).
我的属性slug是"csr-dates".自定义插件由两个文件组成(参见上面的链接):woocommerce-csr-order-email.php和(存储在"includes"文件夹中)class-wc-csr-order-email.php
我想问题出在类文件中,我在这里报告:
<?php
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
/**
* A custom Order WooCommerce Email class
*
* @since 0.1
* @extends \WC_Email
*/
class WC_CSR_Order_Email extends WC_Email {
/**
* Set email defaults
*
* @since 0.1
*/
public function __construct() {
// set ID, this simply needs to be a unique name
$this->id = 'customer_csr_order';
$this->customer_email = true;
// this is the title in WooCommerce Email …Run Code Online (Sandbox Code Playgroud)