Embed the text of your announcement into the email sent to vendors

By default as of this version, WCMp only includes a link to the announcement page of the vendor dashboard in the email that is sent to the vendor. If you would like to add the text to the email, you can override the vendor-new-announcement email template by adding it to your child theme, and adding the following code to it:

<p><?php $post = get_page_by_title($post_title, OBJECT, 'wcmp_vendor_notice');
//echo $post->ID; // your id
echo get_post_field('post_content', $post->ID);?></p>

Here is a full version of my edited email template as an example:

 * The template for displaying demo plugin content.
 * Override this template by copying it to yourtheme/dc-product-vendor/emails/vendor-new-announcement.php
 * @author      WC Marketplace
 * @package     dc-product-vendor/Templates
 * @version   0.0.1
if (!defined('ABSPATH'))
    exit; // Exit if accessed directly 
global $WCMp;
do_action( 'woocommerce_email_header', $email_heading, $email );
$text_align = is_rtl() ? 'right' : 'left';

<p><?php printf(__('<strong>Subject: </strong>%s', 'dc-woocommerce-multi-vendor'),  $post_title); ?></p>

<p><?php $post = get_page_by_title($post_title, OBJECT, 'wcmp_vendor_notice');
//echo $post->ID; // your id
echo get_post_field('post_content', $post->ID);?></p>

<?php $announcement_link = esc_url(wcmp_get_vendor_dashboard_endpoint_url(get_wcmp_vendor_settings('wcmp_vendor_announcements_endpoint', 'vendor', 'general', 'vendor-announcements'))); ?>
<p><a href='https://yoursite.com/dashboard/vendor-announcements/'>All Announcements</a></p>

<p><?php printf(__('Thank you again for being part of the site and please let us know if you have any questions.', 'dc-woocommerce-multi-vendor'), $single); ?></p>

<?php do_action('wcmp_email_footer'); ?>

Tested and working on Woocommerce 4.6.1, WCMp 3.5.10

Is this no longer relevant or not working? Please let us know in the comments!

Comments on this post

Your email address will not be published. Required fields are marked *