I have setup a new class which extends WC_Email
to notify users when a new product has been published.
I am trying to add some text into the footer of this email without effecting the other email templates. I notice within the WC_Email
class, the following is being called in the _constructer to add text into the footer text.
add_filter( 'woocommerce_email_footer_text', array( $this, 'email_footer_replace_site_title' ) );
public
function email_footer_replace_site_title($string)
{
return str_replace( '{site_title}', $this->get_blogname(), $string );
}
I have copied this into my custom class which extends WC_Email like the below but for some reason it's not outputting.
add_filter( 'woocommerce_email_footer_text', array( $this, 'email_footer_replace_site_title' ) );
public
function email_footer_replace_site_title($string)
{
$string .= $string . 'Test';
return str_replace( '{site_title}', $this->get_blogname(), $string );
}
I'm conscious you can hook into the woocommerce_email_footer
action but this outputs before the actual footer text.
Does anyone know how to do this?