Davall del header:
Per afegir contingut davall de l’encapçalament del Email de Woocommerce, utilitzem el hook : woocommerce_email_header( $email_heading, $email ) :
<?php
add_action( 'woocommerce_email_header', 'mm_email_header', 10, 2 );
function mm_email_header( $email_heading, $email ) {
echo "<p> Thanks for shopping with us. We appreciate you and your business!</p>";
}
Abans de la taula:
add_action( 'woocommerce_email_before_order_table', 'mm_email_header', 10, 2 );
function mm_email_header( $email_heading, $email ) {
echo '<h2> ATENCIÓN: NOTICIA</h2>
<p>"<strong>DESTACADO" y "<strong>debes de hacer un.....</p>
<p>"<strong>DESTACADO</strong>" y "<strong>DESTACADO</strong>" frase frase frase.<br></p>';
}
Després de la taula
Per afegir contingut a sota de la taula de comandes, utilitzem: woocommerce_email_after_order_table ($order, $sent_to_admin, $plain_text, $email) .
<?php
add_action( 'woocommerce_email_after_order_table', 'mm_email_after_order_table', 10, 4 );
function mm_email_after_order_table( $order, $sent_to_admin, $plain_text, $email ) {
echo "<p>Hey! Thanks for shopping with us. As a way of saying thanks, here’s a coupon code for your next purchase: FRESH15</p>";
}
Peu de pàgina
Damunt del peu de pàgina, es fa amb el hook : woocommerce_email_footer($email)
<?php
add_action( 'woocommerce_email_footer', 'mm_email_footer', 10, 1 );
function mm_email_footer( $email ) { ?>
<p><?php printf( __( 'Thank you for shopping! Shop for more items using this link: %s', 'woocommerce' ), '<a href="' . get_permalink( wc_get_page_id( 'shop' ) ) . '">' . __( 'Shop', 'woocommerce' ) . '</a>' ); ?></p>
<?php
}
taula amb els hooks
|