• Resolved redmonkey73

    (@redmonkey73)


    Hi!
    We test this plugin for our project, it look great, but i have some problem with add my custom shortcode to email content
    I am Disable setting General->Content->Strip all shortcodes and add my custom shortcode in content email template, but then i got email i just see my shordcode name like [my_custom_shortcede]
    Let me know, can i use custom shortcode in Content field ?
    Thank you!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Kuba Mikita

    (@kubitomakita)

    Hi @redmonkey73, thanks!

    You can use the shortcode but maybe it’s rendered after the notification is sent? How do you register your shortcode? On init action maybe?

    Thread Starter redmonkey73

    (@redmonkey73)

    Hi @kubitomakita, thanks for answear!
    My shortcod register like that

    add_shortcode('sb_show_following','sb_show_following');
    function sb_show_following($atts) {
    echo 'test';
    }
    Thread Starter redmonkey73

    (@redmonkey73)

    Am use this shortcode in custom plugin

    Plugin Author Kuba Mikita

    (@kubitomakita)

    Hmm, it should work fine this case. Let me test this and I’ll come back to you.

    Thread Starter redmonkey73

    (@redmonkey73)

    I am also try make like this
    <?php

    function wporg_shortcodes_init()
    {
        function wporg_shortcode($atts = [], $content = null)
        {
            // do something to $content
     
            // always return
            return $content;
        }
        add_shortcode('wporg', 'wporg_shortcode');
    }
    add_action('init', 'wporg_shortcodes_init');

    in plugin, and in functions.php, but is not help me

    Plugin Author Kuba Mikita

    (@kubitomakita)

    Hi, sorry for the late response. This was actually a bug in the plugin. Now, when you have the Strip all shortcodes setting disabled, the shortcodes are rendered.

    It will be released soon, but if you need this change right now, you can download the development version.

    PS. There’s a bug in your first shortcode. You have to return the value, not echo it.

    • This reply was modified 6 years, 4 months ago by Kuba Mikita.
    Thread Starter redmonkey73

    (@redmonkey73)

    Hi, thank you so much, great news, i will test dev version today, also we wait new version in repo!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Add shortcode in email content’ is closed to new replies.