私はWoocommerceを初めて使いました。メールの冒頭に顧客の名前を表示しようとしています。woocommerceの電子メールテンプレートに顧客名を表示するにはどうすればいいですか?
だから、電子メールは次のようになります:
[HEADER]あなたが配置された注文[/ HEADER]
[H2]こんにちは{CUSTOMER_NAME} [/ H2]
[P]いくつかのテキスト[/ P]
【メールREST]
私はこのようなものを私のテーマのfunctions.phpに追加しようとしました。
//add the first name of the person to the email.
add_filter('woocommerce_email_order_details','name_to_processing_customer_email', 10, 3);
function name_to_processing_customer_email($order, $sent_to_admin, $plain_text, $email) {
if('customer_processing_order' == $email->id){
// Set here as you want your custom content (for customers and email notification related to processing orders only)
echo '<h2>Hej '.$order->billing_first_name .'</h2>';
}
}
しかし、これは機能しません。 誰かを助けることができますか?
それは動作します。ただし、配置が正しくありません。テキストは注文アイテムのすぐ上に表示され、メールヘッダーの直後になりたい。 –