By default, the low stock notification email contains this text.
- "Product-title" is low in stock. There are "XX" left.
I want to edit this message, in order to add the product hyperlink to the product title.
I have found that I can use the following filter hook for this
add_filter( 'woocommerce_email_content_low_stock', 'low_stock_dspixel', 10, 2 );
function low_stock_dspixel( $message, $product ) {
$message = sprintf(/* translators: 1: product name 2: items in stock */
__( '%1$s is low in stock. There are %2$d left.', 'woocommerce' ),
html_entity_decode( wp_strip_all_tags( $product->get_formatted_name() ), ENT_QUOTES, get_bloginfo( 'charset' ) ),
html_entity_decode( wp_strip_all_tags( $product->get_stock_quantity() ) )
);
return $message;
}
How can I further adjust this to add the product hyperlink?