Adding shortcodes to emails

While we do not support WordPress shortcodes out-of-the box in ShopMagic, you can add this filter to your functions.php in your theme to enable shortcodes in email content:

add_filter( 'shopmagic/core/action/sendmail/raw_message', 'do_shortcode' );

This filter was added in ShopMagic 2.2, so it won't work in previous versions.

We do not support shortcodes by default, because we found the markup output by shortcodes was generally not intended for use in HTML emails, and could break the display of the email.

That said, if you know the shortcode content is email safe, it is possible to enable shortcode evaluation in emails with the snippet above. That will apply the do_shortcode() function to email content to expand shortcodes.

It works in all email actions:

  • Send Email
  • Send Email - Raw HTML
  • Send Email - Plain Text
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us