【问题标题】:Get users information in Woocommerce email template在 Woocommerce 电子邮件模板中获取用户信息
【发布时间】:2019-08-05 04:27:40
【问题描述】:

在 Woocommerce 中,我正在尝试向我的客户发送自定义电子邮件通知,我需要获取客户信息,例如名字、电子邮件地址、姓氏……等。

我在哪里可以获得电子邮件模板的客户信息?

【问题讨论】:

    标签: php html wordpress woocommerce email-notifications


    【解决方案1】:

    我主要在所有相关的电子邮件 Woocommerce 模板上,您可以使用 WC_Order 对象 $order 变量。因此,从这个WC_Order 对象中,您可以使用以下内容:

    然后您可以通过这种方式使用可用的WC_Order methods 获取所有详细信息:

    $first_name = $order->get_billing_first_name(); // First name
    $Last_name  = $order->get_billing_last_name(); // Last name
    $email      = $order->get_billing_email(); // Email address
    

    有关其他用户需要的详细信息,请参阅:How to get WooCommerce order details

    【讨论】:

    • 感谢您的帮助!
    猜你喜欢
    • 1970-01-01
    • 2018-04-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多