WooCommerce订阅取消电子邮件给供应商

时间:2020-06-18 03:27:41

标签: php wordpress woocommerce

我正在使用WooCommerce订阅。 &我使用wcfm来管理供应商,每个供应商都在我的商店中出售订阅,因此我需要供应商以及客户接收取消电子邮件。我试图使用供应商插件中的代码构建以下代码。

发送给客户的代码:

/* Send email to a customer on cancelled subscription in WooCommerce */
add_action( 'woocommerce_subscription_status_pending-cancel', 'sendCustomerCancellationEmail' );
/**
 * @param WC_Subscription $subscription
 */
function sendCustomerCancellationEmail( $subscription ) {
    $customer_email = $subscription->get_billing_email();
    $wc_emails = WC()->mailer()->get_emails();
    $wc_emails['WCS_Email_Cancelled_Subscription']->recipient = $customer_email;
    $wc_emails['WCS_Email_Cancelled_Subscription']->trigger( $subscription );

我已经找到了一些供应商的信息,例如

$this->vendor_id    = $vendor_id;
                        $this->recipient    = $vendor_email;
                        $this->vendor_email = $vendor_email;

foreach( $order_vendors as $vendor_id => $vendor_email ) {

所以我认为可以将$ vendor_email与上述代码一起使用,但是我不够聪明,无法确切地确定需要什么?专业人士有什么建议吗?

谢谢

0 个答案:

没有答案