You can override the default email templates used by Burst Statistics by creating custom versions and using WordPress filters.
In this article we will show how to customize. As an example, we will edit the email to remove the “read more” button, and to remove the buttons on each statistics block in the mail. This can be useful if you are sending the e-mail to customers who do not have a WordPress account.
Steps to Override Templates
- Copy Template Files
Copy the default template files from the Burst plugin directory:
wp-content/plugins/burst-statistics/includes/Admin/Mailer/templates/block.html
wp-content/plugins/burst-statistics/includes/Admin/Mailer/templates/read-more.html
For pro plugins, look up plugins/burst-pro instead of burst-statistics
- Copy the files to the uploads directory
wp-content/uploads/burst/templates/ - Modify Templates
For read-more.html: Remove all content (make it an empty file)
For block.html: Remove the following lines:
<a href=”{url}” style=”color: #696969;”>
{learn-more}
</a>
4. Create MU-Plugin
Create a new file: wp-content/mu-plugins/burst-custom-email-templates.php
Add the following code:
<?php
add_filter( ‘burst_email_block_template’, function() {
$upload_dir = wp_upload_dir();
return $upload_dir[‘basedir’] . ‘/burst/templates/block.html’;
});
add_filter( ‘burst_email_readmore_template’, function() {
$upload_dir = wp_upload_dir();
return $upload_dir[‘basedir’] . ‘/burst/templates/read-more.html’;
});
5. Verify
Your custom templates will now be used for all Burst email reports. The changes will take effect immediately without needing to modify the plugin files directly.