当客户取消订阅时,我将取消电子邮件发送给管理员和客户
public Rigidbody2D rb;
void Start() {
rb = GetComponent < Rigidbody2D > ();
}
void FixedUpdate() {
bool activeRotation = Input.GetButton("Fire1");
rb.AddForce(new Vector2(5f * time.DeltaTime, 0f));
if (activeRoattion == true) {
transform.Rotate(new Vector3(0, 0, 6));
}
}
我需要使用我创建的电子邮件模板向客户发送不同的自定义电子邮件。我在想我需要用类似这样的代码替换上面的代码
/* Send email to customer on cancelled order in WooCommerce */
add_action('woocommerce_subscription_status_updated', 'send_custom_email_notifications', 10, 3 );
function send_custom_email_notifications( $subscription, $new_status, $old_status ){
if ( $new_status == 'cancelled' || $new_status == 'pending-cancel' ){
$customer_email = $subscription->get_billing_email();
$userid = $subscription->get_user_id();
$wc_emails = WC()->mailer()->get_emails();
$wc_emails['WC_Email_Cancelled_Order']->recipient .= ',' . $customer_email;
$wc_emails['WC_Email_Cancelled_Order']->trigger( $orderid );
}
}
但尚未找到它。
更新
当客户取消订阅时,此代码将分别发送两封电子邮件;一个是作为收件人的电子邮件地址(WooCommerce,设置,电子邮件,已取消的订阅,收件人),另一个是给客户。自定义客户电子邮件将保存到主题的WooCommerce,Email文件夹中,并将覆盖WooCommerce默认模板文件。
但是当管理员从“编辑订单”屏幕上取消订阅时,电子邮件不会发送给客户。
$wc_emails['WC_Email_Custom_Template']->$customer_email;
$wc_emails['WC_Email_Custom_Template']->trigger( $orderid );