Hi,
thanks for your question, and sorry for the trouble.
The reason for this likely is that TablePress only registers its Shortcode on the frontend of the site, but that the Email Users plugin operates in the wp-admin context.
To work around that, you could try registering the Shortcodes in the admin context as well, e.g. using the suggestion in https://ww.wp.xz.cn/support/topic/tablepress-shortcode-not-working-with-woocommerce-ajax?replies=4
Regards,
Tobias
Hi Tobias – TablePress is also very good!
Your suggestion doesn’t seem to have worked for me though? I added the code to my functions.php but it has made no difference. From what I can see of the Email Users plugin, it is using the do_shortcode function call to try to convert the shortcodes into the full post:
$post_content = do_shortcode($post_content)
Does this shed any light on your approach? Are there other ways to get TablePress active within the wp-admin backend?
Thanks
Gareth
Hi Gareth,
ah, it looks like that code from the other post does not apply to this scenario. Please try again with
add_action( 'init', 'load_tablepress_in_the_admin', 11 ) );
function load_tablepress_in_the_admin() {
if ( is_admin() ) {
TablePress::load_controller( 'frontend' );
}
}
Regards,
Tobias
Hi Tobias,
That’s worked – I now get a plain table version of any TablePress inserted tables into the Notify Users About This Post email preview. I can then apply a bit of simple formatting (mainly set all borders to 1, width to 100%) before it gets sent out. It would be great if I could define a simple default format for tables within Email Users rather than have to do it by hand.
Thanks,
Gareth
Hi Gareth,
Good to hear that this worked! 🙂
About the styling: This is not really in TablePress’s hands, I’m afraid, as it depends on what CSS the Email Users plugin loads.
Best wishes,
Tobias