Viewing 15 replies - 1 through 15 (of 17 total)
  • @bigs38,

    Are the shortcodes registered using the core WordPress functions by the other plugin?

    Looking at my code, any short codes that are core registered should get stripped out of the plain text emails.

    @bigs38,

    Having ha d a quick look through the “Shortcodes Pro” code it seems it creates a new shortcode and piggy backs the user defined ones onto it.

    Around line 539 in classes-class-s2-core.php you should find this code:

    if ( function_exists('strip_shortcodes') ) {
    	$plaintext = strip_shortcodes($plaintext);
    }

    Try changing the ‘strip_shortcodes’ to ‘do_shortcode’ and see of that gets things working on your site.

    Thread Starter bigs38

    (@bigs38)

    I try to change the ‘strip_shortcodes’ to ‘do_shortcode’ in classes-class-s2-core.php but it’s the same result …

    Do you have another idea.

    Thanks for your help.

    @bigs38,

    Is this happening for all 4 email types in per-post mode or are you using digest mode?

    Thread Starter bigs38

    (@bigs38)

    Yes for all 4 email it’s the same result.

    @bigs38,

    I need to reproduce the situation so I will get the shortcode plugin and do some debugging. I’ll get back to you when I know more.

    @bigs38,

    This issue arises because the shortcode pro plugin does not register the shortcode in the admin screens, only on the front end of your site. That means that the shortcode is not processed when the post is published in the admin screens. It can only be fixed by an edit to the short codes pro plugin.

    In the /inc/class-shortcoespro-type.php file fine the init() function on line 42. In there you will see:

    if ( is_admin() )
    	$this->_custom_define_metaboxes(); // define metaboxes
    else {

    Change this to

    if ( is_admin() ) {
    	$this->_custom_define_metaboxes(); // define metaboxes
    	$this->_register_shortcode();
    } else {

    Thread Starter bigs38

    (@bigs38)

    I try your suggestion, it works now for the HTML option in “shortcodes pro” plugin, but it dont work with the php option.

    I use the Shortcodes Pro plugin because it have this option…
    For exemple I use the the_post_thumbnail(‘medium’) fonction to add the “Featured image” in my post with a special link to a gallery.

    I would really like to thank you for your help and to take the time to have a look on an other plugin.

    @bigs38,

    Subscribe2 sends 4 different emails, HTML with full or excerpt content and plain get with full or excerpt content.

    The plain text emails won’t support formatting or things like images so what you see after the edit is expected, images will be included in the HTML emails but not the plain text ones.

    Thread Starter bigs38

    (@bigs38)

    Yes I know, I speak about HTML/PHP option in “Shortcodes Pro” plugin.
    When I use shortcodes, images aren’t included in the HTML emails…

    Thread Starter bigs38

    (@bigs38)

    For exemple, if you use “Featured Image” you can create a shortcode with Shortcodes Pro like this :

    Select language : PHP
    with the code:
    echo the_post_thumbnail('medium');

    Now, when you use the shortcode in your post you have the featured image in it, but if you try to send email you dont have the featured image inside.

    @bigs38,

    I’m not sure how that could be made to work as the ‘echo’ statement sends the information to the browser window rather than the email that Subscribe2 sends. Sadly, sometimes two plugins cannot be made to work together flawlessly. I don’t think that this issue can be fixed.

    Thread Starter bigs38

    (@bigs38)

    echo is not necessary (I made a mistake…) the result is still the same for posts, I have images inside, and for the email notifications without images.

    Thanks again for your help and have an HAPPY NEW YEAR !!!!!

    @bigs38,

    Have you tried adding ‘return’ before the function call like:
    return the_post_thumbnail('medium');

    It then goes into the HTML emails in my tests.

    Thread Starter bigs38

    (@bigs38)

    Same result with return before the function call.

    I have made a lots of tests, for the moment my configuration is :
    For the Shortcode:
    In php I have only : return the_post_thumbnail(‘medium’);

    For the file class-shortcoespro-type.php
    I have add $this->_register_shortcode(); like you said

    For the templates in Subscribe2:
    in “New Post email” I have only write {POST} and I don’t include css file in email.

    Do you have a similar configuration ? and it works for you ?

    If I add an image directly in the post I receive it by email.

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Custom shortcode in a post is interpreted as text in e-mail’ is closed to new replies.