Shortcodes are disabled by default in Mailster and will get removed from your campaign. The reason is that short codes can inject almost any HTML which may break the whole email.
If you like to enable shortcodes in Mailster you can enable this option on the advanced settings page:
No matter which option you choose all registered shortcodes will be removed in the final email, either processed or just stripped.
Examples
Assuming foo
and bar
are registered via add_shortcode
the output will be as follows:
ShortCode | Output (enabled) | Output (disabled) |
[foo] | [return value of “foo”] | empty String |
[bar]Content[/bar] | [return value of “bar”] | Content |
[foo attr=”true”] | [return value of “foo”] | empty String |
[bar attr=”true”]Content[/bar] | [return value of “bar”] | Content |
Adding additional shortcodes
Some shortcodes are may not include at the time when Mailster process them so you have to add them manually:
add_filter( 'mailster_strip_shortcode_tags', function( $shortcode_tags ){
$shortcode_tags[] = 'my_custom_shortcode';
return shortcode_tags;
});
Deprecated Method
Since 2.4.13 Mailster has the option in the settings. If you changed this option for a previous version you may have this in your code:
add_filter( 'mailster_strip_shortcodes', '__return_false' );
Mailster will still respect this setting but it’s encouraged to remove it and reply on the settings.