最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Woocommerce - Add custom email footer to specific email template

programmeradmin0浏览0评论

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?

发布评论

评论列表(0)

  1. 暂无评论