WooCommerce「メールテンプレート」を編集する
本ページではWooCommerceのメールテンプレートを修正する方法をご案内します。
有効化/無効化、メール件名、メールヘッダー、追加コンテンツの変更については下記をご確認ください。
❗ 注意1
子テーマを利用せずにメールテンプレートの編集をすると、Japacartテーマが更新された際にテンプレートが消えてしまいます。
[外見] > [テーマ] でJapacart子テーマが「有効」になっていることをご確認ください。

子テーマのインストールについては下記ページをご覧ください。
❗ 注意2
ご利用のサーバーでWAF(ウェブアプリケーションファイアウォール)がオンになっている場合、テンプレートの保存ができない場合があります。
その場合は一時的にオフにして、作業後、速やかにオンに戻してください。
❗ 注意3
メール本文の変更はPHPファイルの編集となるため、少しでも記述を誤ると、メールが届かなくなったり、サイトの動作に不具合が生じます。
変更をされた後はメールの送受信やサイトの動作確認を十分に行ってください。
2020年8月現在、WooCommerceからお客様に届くメールの宛先は「下の名前 + 様」になっています。
とてもフレンドリーなのですが、日本だと違和感があります。
またメール本文もショップの設定や取り扱う商品などにより変更する方が良いでしょう。

メールの本文を変更するには、WooCommerce側で用意されているメール用のテンプレート(ひな型)を上書き修正する必要があります。
当ページでは下記のメールのテンプレートを上書きするためのコードをご用意しました。
宛名は「山田 花子 様」の様にフルネームになるように調整済です。
変更手順
[WooCommerce] > [設定] > [メール] タブを選択し、変更するメールの [管理] ボタンを押してメール設定ページに移動します。

HTMLテンプレートの [テーマにファイルをコピー] を押します。
メールテンプレート(phpファイル)がJapacart子テーマ内にコピーされます。

PHPテンプレート編集欄が白くなり、編集可能となります。
この編集欄に変更後のメールテンプレートのPHPコードをコピー&ペーストしてください。

💡 テンプレートの編集を最初からやり直すには [テンプレートファイルを削除します] をクリックしてテンプレートを削除してから再度[テーマにファイルをコピー] を押して下さい。
変更後のメールテンプレートのPHPコード(WooCommerce バージョン4.4)
「メッセージ ここから」「メッセージ ここまで」で囲んでいるテキストはご自身の設定やショップに合うようにご変更ください。
<!-- ********************* XXXXXメッセージ ここから ********************* -->
この部分のテキストを変更してください。
<!-- ********************* XXXXXメッセージ ここまで ********************* -->
注文保留メール
HTML形式
<?php
/**
* Customer on-hold order email
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/customer-on-hold-order.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://docs.woocommerce.com/document/template-structure/
* @package WooCommerce/Templates/Emails
* @version 3.7.0
*/
defined( 'ABSPATH' ) || exit;
/*
* @hooked WC_Emails::email_header() Output the email header
*/
do_action( 'woocommerce_email_header', $email_heading, $email ); ?>
<p><?php printf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_formatted_billing_full_name() ) ); ?></p>
<p>
<!-- ********************* 注文保留メッセージ ここから 改行は<br>タグを使用してください ********************* -->
この度はご注文ありがとうございます。お支払いを確認次第、商品の発送準備に入ります。
<!-- ********************* 注文保留メッセージ ここまで ********************* -->
</p>
<?php
/*
* @hooked WC_Emails::order_details() Shows the order details table.
* @hooked WC_Structured_Data::generate_order_data() Generates structured data.
* @hooked WC_Structured_Data::output_structured_data() Outputs structured data.
* @since 2.5.0
*/
do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email );
/*
* @hooked WC_Emails::order_meta() Shows order meta data.
*/
do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email );
/*
* @hooked WC_Emails::customer_details() Shows customer details
* @hooked WC_Emails::email_address() Shows email address
*/
do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email );
/**
* Show user-defined additional content - this is set in each email's settings.
*/
if ( $additional_content ) {
echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) );
}
/*
* @hooked WC_Emails::email_footer() Output the email footer
*/
do_action( 'woocommerce_email_footer', $email );
プレーンテキスト形式
<?php
/**
* Customer on-hold order email
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/customer-on-hold-order.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://docs.woocommerce.com/document/template-structure/
* @package WooCommerce/Templates/Emails/Plain
* @version 3.7.0
*/
defined( 'ABSPATH' ) || exit;
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=n";
echo esc_html( wp_strip_all_tags( $email_heading ) );
echo "n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=nn";
echo sprintf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_formatted_billing_full_name() ) ) ;
echo <<<'EOL'
<!-- ********************* 注文保留メッセージ ここから ********************* -->
この度はご注文ありがとうございます。お支払いを確認次第、商品の発送準備に入ります。
<!-- ********************* 注文保留メッセージ ここまで ********************* -->
EOL;
/*
* @hooked WC_Emails::order_details() Shows the order details table.
* @hooked WC_Structured_Data::generate_order_data() Generates structured data.
* @hooked WC_Structured_Data::output_structured_data() Outputs structured data.
* @since 2.5.0
*/
do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email );
echo "n----------------------------------------nn";
/*
* @hooked WC_Emails::order_meta() Shows order meta data.
*/
do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email );
/*
* @hooked WC_Emails::customer_details() Shows customer details
* @hooked WC_Emails::email_address() Shows email address
*/
do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email );
echo "nn----------------------------------------nn";
/**
* Show user-defined additional content - this is set in each email's settings.
*/
if ( $additional_content ) {
echo esc_html( wp_strip_all_tags( wptexturize( $additional_content ) ) );
echo "nn----------------------------------------nn";
}
echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) );
処理中の注文メール
HTML形式
<?php
/**
* Customer processing order email
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/customer-processing-order.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://docs.woocommerce.com/document/template-structure/
* @package WooCommerce/Templates/Emails
* @version 3.7.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/*
* @hooked WC_Emails::email_header() Output the email header
*/
do_action( 'woocommerce_email_header', $email_heading, $email ); ?>
<p><?php printf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_formatted_billing_full_name() ) ); ?></p>
<p>
<!-- ********************* 処理中メッセージ ここから 改行は<br>タグを使用してください ********************* -->
この度はご注文ありがとうございます。商品の発送まで今しばらくお待ちくださいませ。<br>
ご注文の内容は以下の通りです。
<!-- ********************* 処理中メッセージ ここまで ********************* -->
</p>
<?php
/*
* @hooked WC_Emails::order_details() Shows the order details table.
* @hooked WC_Structured_Data::generate_order_data() Generates structured data.
* @hooked WC_Structured_Data::output_structured_data() Outputs structured data.
* @since 2.5.0
*/
do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email );
/*
* @hooked WC_Emails::order_meta() Shows order meta data.
*/
do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email );
/*
* @hooked WC_Emails::customer_details() Shows customer details
* @hooked WC_Emails::email_address() Shows email address
*/
do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email );
/**
* Show user-defined additional content - this is set in each email's settings.
*/
if ( $additional_content ) {
echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) );
}
/*
* @hooked WC_Emails::email_footer() Output the email footer
*/
do_action( 'woocommerce_email_footer', $email );
プレーンテキスト形式
<?php
/**
* Customer processing order email
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/customer-processing-order.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://docs.woocommerce.com/document/template-structure/
* @package WooCommerce/Templates/Emails/Plain
* @version 3.7.0
*/
defined( 'ABSPATH' ) || exit;
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=n";
echo esc_html( wp_strip_all_tags( $email_heading ) );
echo "n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=nn";
echo sprintf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_formatted_billing_full_name() ) ) ;
echo <<<'EOL'
<!-- ********************* 処理中メッセージ ここから ********************* -->
この度はご注文ありがとうございます。商品の発送まで今しばらくお待ちくださいませ。
ご注文の内容は以下の通りです。
<!-- ********************* 処理中メッセージ ここまで ********************* -->
EOL;
/*
* @hooked WC_Emails::order_details() Shows the order details table.
* @hooked WC_Structured_Data::generate_order_data() Generates structured data.
* @hooked WC_Structured_Data::output_structured_data() Outputs structured data.
* @since 2.5.0
*/
do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email );
echo "n----------------------------------------nn";
/*
* @hooked WC_Emails::order_meta() Shows order meta data.
*/
do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email );
/*
* @hooked WC_Emails::customer_details() Shows customer details
* @hooked WC_Emails::email_address() Shows email address
*/
do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email );
echo "nn----------------------------------------nn";
/**
* Show user-defined additional content - this is set in each email's settings.
*/
if ( $additional_content ) {
echo esc_html( wp_strip_all_tags( wptexturize( $additional_content ) ) );
echo "nn----------------------------------------nn";
}
echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) );
完了済みの注文メール
HTML形式
<?php
/**
* Customer completed order email
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/customer-completed-order.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://docs.woocommerce.com/document/template-structure/
* @package WooCommerce/Templates/Emails
* @version 3.7.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/*
* @hooked WC_Emails::email_header() Output the email header
*/
do_action( 'woocommerce_email_header', $email_heading, $email ); ?>
<p><?php printf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_formatted_billing_full_name() ) ); ?></p>
<p>
<!-- ********************* 完了済みメッセージ ここから 改行は<br>タグを使用してください ********************* -->
この度はご利用ありがとうございました。<br>
ご注文の内容は以下の通りです。
<!-- ********************* 完了済みメッセージ ここまで ********************* -->
</p>
<?php
/*
* @hooked WC_Emails::order_details() Shows the order details table.
* @hooked WC_Structured_Data::generate_order_data() Generates structured data.
* @hooked WC_Structured_Data::output_structured_data() Outputs structured data.
* @since 2.5.0
*/
do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email );
/*
* @hooked WC_Emails::order_meta() Shows order meta data.
*/
do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email );
/*
* @hooked WC_Emails::customer_details() Shows customer details
* @hooked WC_Emails::email_address() Shows email address
*/
do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email );
/**
* Show user-defined additional content - this is set in each email's settings.
*/
if ( $additional_content ) {
echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) );
}
/*
* @hooked WC_Emails::email_footer() Output the email footer
*/
do_action( 'woocommerce_email_footer', $email );
プレーンテキスト形式
<?php
/**
* Customer completed order email (plain text)
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/customer-completed-order.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://docs.woocommerce.com/document/template-structure/
* @package WooCommerce/Templates/Emails/Plain
* @version 3.7.0
*/
defined( 'ABSPATH' ) || exit;
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=n";
echo esc_html( wp_strip_all_tags( $email_heading ) );
echo "n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=nn";
echo sprintf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_formatted_billing_full_name() ) ) ;
echo <<<'EOL'
<!-- ********************* 完了済みメッセージ ここから ********************* -->
この度はご利用ありがとうございました。
ご注文の内容は以下の通りです。
<!-- ********************* 完了済みメッセージ ここまで ********************* -->
EOL;
/*
* @hooked WC_Emails::order_details() Shows the order details table.
* @hooked WC_Structured_Data::generate_order_data() Generates structured data.
* @hooked WC_Structured_Data::output_structured_data() Outputs structured data.
* @since 2.5.0
*/
do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email );
echo "n----------------------------------------nn";
/*
* @hooked WC_Emails::order_meta() Shows order meta data.
*/
do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email );
/*
* @hooked WC_Emails::customer_details() Shows customer details
* @hooked WC_Emails::email_address() Shows email address
*/
do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email );
echo "nn----------------------------------------nn";
/**
* Show user-defined additional content - this is set in each email's settings.
*/
if ( $additional_content ) {
echo esc_html( wp_strip_all_tags( wptexturize( $additional_content ) ) );
echo "nn----------------------------------------nn";
}
echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) );
払い戻し注文メール
HTML形式
<?php
/**
* Customer refunded order email
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/customer-refunded-order.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://docs.woocommerce.com/document/template-structure/
* @package WooCommerce/Templates/Emails
* @version 3.7.0
*/
defined( 'ABSPATH' ) || exit;
/*
* @hooked WC_Emails::email_header() Output the email header
*/
do_action( 'woocommerce_email_header', $email_heading, $email ); ?>
<p><?php printf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_formatted_billing_full_name() ) ); ?></p>
<p>
<?php
if ( $partial_refund ): ?>
<p>
<!-- ********************* 一部払い戻し時メッセージ ここから 改行は<br>タグを使用してください ********************* -->
ご注文の一部を取り消し、返金処理を行いましたのでご連絡申し上げます。<br>
詳細は下記をご確認ください。
<!-- ********************* 一部払い戻し時メッセージ ここまで ********************* -->
</p>
<?php else: ?>
<p>
<!-- ********************* 全額払い戻し時メッセージ ここから 改行は<br>タグを使用してください ********************* -->
ご注文をキャンセルし、返金処理を行いましたのでご連絡申し上げます。<br>
詳細は下記をご確認ください。
<!-- ********************* 全額払い戻し時メッセージ ここまで ********************* -->
</p>
<?php endif; ?>
</p>
<?php
/*
* @hooked WC_Emails::order_details() Shows the order details table.
* @hooked WC_Structured_Data::generate_order_data() Generates structured data.
* @hooked WC_Structured_Data::output_structured_data() Outputs structured data.
* @since 2.5.0
*/
do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email );
/*
* @hooked WC_Emails::order_meta() Shows order meta data.
*/
do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email );
/*
* @hooked WC_Emails::customer_details() Shows customer details
* @hooked WC_Emails::email_address() Shows email address
*/
do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email );
/**
* Show user-defined additional content - this is set in each email's settings.
*/
if ( $additional_content ) {
echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) );
}
/*
* @hooked WC_Emails::email_footer() Output the email footer
*/
do_action( 'woocommerce_email_footer', $email );
プレーンテキスト形式
<?php
/**
* Customer refunded order email (plain text)
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/customer-refunded-order.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://docs.woocommerce.com/document/template-structure/
* @package WooCommerce/Templates/Emails/Plain
* @version 3.7.0
*/
defined( 'ABSPATH' ) || exit;
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=n";
echo esc_html( wp_strip_all_tags( $email_heading ) );
echo "n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=nn";
echo sprintf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_formatted_billing_full_name() ) ) ;
if ( $partial_refund ) {
echo <<<'END'
<!-- ********************* 一部払い戻し時メッセージ ここから ********************* -->
ご注文の一部を取り消し、返金処理を行いましたのでご連絡申し上げます。
詳細は下記をご確認ください。
<!-- ********************* 一部払い戻し時メッセージ ここまで ********************* -->
END;
} else {
echo <<<'EOL'
<!-- ********************* 全額払い戻し時メッセージ ここから ********************* -->
ご注文をキャンセルし、返金処理を行いましたのでご連絡申し上げます。
詳細は下記をご確認ください。
<!-- ********************* 全額払い戻し時メッセージ ここまで ********************* -->
EOL;
}
/*
* @hooked WC_Emails::order_details() Shows the order details table.
* @hooked WC_Structured_Data::generate_order_data() Generates structured data.
* @hooked WC_Structured_Data::output_structured_data() Outputs structured data.
* @since 2.5.0
*/
do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email );
echo "n----------------------------------------nn";
/*
* @hooked WC_Emails::order_meta() Shows order meta data.
*/
do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email );
/*
* @hooked WC_Emails::customer_details() Shows customer details
* @hooked WC_Emails::email_address() Shows email address
*/
do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email );
echo "nn----------------------------------------nn";
/**
* Show user-defined additional content - this is set in each email's settings.
*/
if ( $additional_content ) {
echo esc_html( wp_strip_all_tags( wptexturize( $additional_content ) ) );
echo "nn----------------------------------------nn";
}
echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) );
注文メモメール
HTML形式
<?php
/**
* Customer note email
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/customer-note.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://docs.woocommerce.com/document/template-structure/
* @package WooCommerce/Templates/Emails
* @version 3.7.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/*
* @hooked WC_Emails::email_header() Output the email header
*/
do_action( 'woocommerce_email_header', $email_heading, $email ); ?>
<p><?php printf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_formatted_billing_full_name() ) ); ?></p>
<p>
<!-- ********************* 注文メモメッセージ ここから 改行は<br>タグを使用してください ********************* -->
ご注文に関してお知らせしたいことがございましたのでご連絡させていただきました。
<!-- ********************* 注文メモメッセージ ここまで ********************* -->
</p>
<blockquote><?php echo wpautop( wptexturize( make_clickable( $customer_note ) ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></blockquote>
<?php
/*
* @hooked WC_Emails::order_details() Shows the order details table.
* @hooked WC_Structured_Data::generate_order_data() Generates structured data.
* @hooked WC_Structured_Data::output_structured_data() Outputs structured data.
* @since 2.5.0
*/
do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email );
/*
* @hooked WC_Emails::order_meta() Shows order meta data.
*/
do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email );
/*
* @hooked WC_Emails::customer_details() Shows customer details
* @hooked WC_Emails::email_address() Shows email address
*/
do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email );
/**
* Show user-defined additional content - this is set in each email's settings.
*/
if ( $additional_content ) {
echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) );
}
/*
* @hooked WC_Emails::email_footer() Output the email footer
*/
do_action( 'woocommerce_email_footer', $email );
プレーンテキスト形式
<?php
/**
* Customer note email
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/customer-note.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://docs.woocommerce.com/document/template-structure/
* @package WooCommerce/Templates/Emails/Plain
* @version 3.7.0
*/
defined( 'ABSPATH' ) || exit;
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=n";
echo esc_html( wp_strip_all_tags( $email_heading ) );
echo "n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=nn";
echo sprintf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_formatted_billing_full_name() ) ) ;
echo <<<'EOL'
<!-- ********************* 注文メモメッセージ ここから ********************* -->
ご注文に関してお知らせしたいことがございましたのでご連絡させていただきました。
<!-- ********************* 注文メモメッセージ ここまで ********************* -->
EOL;
echo wptexturize( $customer_note ) . "nn"; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
/*
* @hooked WC_Emails::order_details() Shows the order details table.
* @hooked WC_Structured_Data::generate_order_data() Generates structured data.
* @hooked WC_Structured_Data::output_structured_data() Outputs structured data.
* @since 2.5.0
*/
do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email );
echo "n----------------------------------------nn";
/*
* @hooked WC_Emails::order_meta() Shows order meta data.
*/
do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email );
/*
* @hooked WC_Emails::customer_details() Shows customer details
* @hooked WC_Emails::email_address() Shows email address
*/
do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email );
echo "nn----------------------------------------nn";
/**
* Show user-defined additional content - this is set in each email's settings.
*/
if ( $additional_content ) {
echo esc_html( wp_strip_all_tags( wptexturize( $additional_content ) ) );
echo "nn----------------------------------------nn";
}
echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) );
Japacartユーザーの場合はマイアカウントにログインの上、コメントしてください。
コメントに表示される名前はマイアカウント > アカウント詳細の「表示名」になります。
コメント欄は承認されるまで表示されません。