Woo Commerce新用户电子邮件 [英] Woo commerce new user email

查看:42
本文介绍了Woo Commerce新用户电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了一个自定义插件来处理我的WordPress Woocommerce网站的登录和注册.

I wrote a custom plugin that handles login and registration for my WordPress Woocommerce site.

当用户通过我的自定义表单处理程序注册时,我想触发Woocommerce向新用户发送电子邮件,而不是使用wp_mail.这样,我减少了代码冗余,并且所有事务性电子邮件都可以设置为相同的格式(它们的外观和风格都相同).

When a user registers via my custom form handler I would like to trigger Woocommerce to send the new user an email instead of using wp_mail. This way I reduce code redundancy, and all of the transactional emails can be formatted the same (they all have the same look and feel).

有可能这样做吗?

推荐答案

尝试一下:

$wc = new WC_Emails();
$wc->customer_new_account($user_id);

$ customerID应该是新创建的客户的ID.在这里,您可以找到有关WC_Email_Customer_New_Account类的所有信息: https://docs.woocommerce.com/wc-apidocs/class-WC_Email_Customer_New_Account.html .只要将此代码放置在客户注册后将在其运行的某个位置,所以我假设您将在其中放置wp_mail函数的某个位置.让我知道这是否有帮助:)

$customerID should be the ID of the newly created customer. Here you can find out everything about the WC_Email_Customer_New_Account class: https://docs.woocommerce.com/wc-apidocs/class-WC_Email_Customer_New_Account.html. Just place this code somewhere where it will run after the customer has been registered, so I assume somewhere where you would have placed the wp_mail functions. Let me know if this helped :)

这篇关于Woo Commerce新用户电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆