Woocommerce HTML email option unavailable

I am attempting to create HTML emails in woocommerce. I currently only have the plain text email option available. I have added the following to functions.php on my theme:

function wps_set_content_type(){
  return "text/html";
}
add_filter( 'wp_mail_content_type','wps_set_content_type' );

As well I have installed the following php modules php-gd, php-xml and php-xmlrpc. I have restarted apache after installation and verified that all modules are available.

The odd thing is that when I check the options locally, I have the HTML option. When I check on the live server there is only the plain text option. Locally I am running PHP 5.6.14-1+deb.sury.org~trusty+1 (cli) on the live server I am running PHP 7.0.20 (cli) (built: Jun 10 2017 06:34:07) ( NTS ). Surely PHP7 can handle this right?

Does anyone have a clue on what else I could try?

Topic woocommerce-offtopic html-email functions php email Wordpress

Category Web


I think you missing function argument. just try it.

add_filter('wp_mail_content_type','set_content_type');
    function set_content_type($content_type){
      return 'text/html';
    }

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.