If you’re running a WooCommerce Shop and like to send your latest products to your audience you can use Mailster with the WooCommerce add-on.
Since WooCommerce products are custom post types you can create any auto-responder campaign and use your products.
Static Content
Enable “Products” on the static page of in the edit bar and you will get all public products in reverse chronological order.
You’ll get your product instantly in your campaign:
Dynamic Content
Select the “dynamic” tab and “Products” from the drop-down. You can limit your results by categories (taxonomies).
A dynamic Module uses placeholders like{product_title:-1}
to get the latest post title. Read more about tags here.
Adding Metadata
You can also include metadata to your content with the {product_meta[XXX]}
tag.
Display the price of the item
Use {product_meta[_regular_price]:-1}
Display the sales price of the item
Use {product_meta[_sale_price]:-1}
Formatting the output
Since WooCommerce stores the metadata without formatting and you would rather see “$ 9,99” instead of “9.99” you have to add some custom filters to your site:
add_filter( 'mailster_replace_product_meta', function( $replace_to, $post, $meta_field ) {
if ( '_regular_price' == $meta_field || '_sales_price' == $meta_field ) {
$replace_to = wc_price( $replace_to );
}
return $replace_to;
}, 10, 3 );
Read more on how to add custom code to your website here.