Subscribe-by-email plugin not showing excerpt

Hi

For some reason, the notification emails sent by Subscribe-by-email does not contain any excerpt content. This area of the email is just completely blank.

While I can write my own function to try to do this, I see that it already was built to include a short excerpt of the post, but I am not sure why it is not showing.

Can someone tell me exactly which functions/classes gets invoked during the plugin workflow that generates the email content with the excerpt?

Thanks for your help

  • Vinod Dalvi

    Hi @DjHRIS,

    I hope you are well today and thank you for your question.

    Can someone tell me exactly which functions/classes gets invoked during the plugin workflow that generates the email content with the excerpt?

    You will find it in the following plugin file on line number 77

    subscribe-by-email/inc/mail-templates/mail-template.php

    For troubleshooting you can just try deactivating all other plugins and using default WordPress theme like Twenty Twelve as described in the flowchart on the following page.

    https://premium.wpmudev.org/manuals/getting-support/

    Best Regards,
    Vinod Dalvi

  • DjHRIS

    The problem is:

    Before it gets to the_content($content) function, the actual $content array that is passed into the function, as generated by Line 408 $user_content = $this->content_generator->filter_user_content( $key );
    is completely empty of post_excerpt and post_content. Here is the content array being passed into the_content function:

    Array ( [0] => WP_Post Object ( [ID] => 1721 [post_author] => 1 [post_date] => 2014-01-15 16:33:25 [post_date_gmt] => 2014-01-15 16:33:25 [post_content] => [post_title] => test123 [post_excerpt] => [post_status] => publish [comment_status] => closed [ping_status] => closed [post_password] => [post_name] => test123-2 [to_ping] => [pinged] => [post_modified] => 2014-01-15 16:33:25 [post_modified_gmt] => 2014-01-15 16:33:25 [post_content_filtered] => [post_parent] => 0 [guid] => http://xxx.xxx.com/?post_type=press-room&p=1721 [menu_order] => 0 [post_type] => press-room [post_mime_type] => [comment_count] => 0 [filter] => raw ) )

  • DjHRIS

    Hello

    I have investigated it for some time and I found that the plugin is significantly conflicting with the custom theme that we are using.

    First, the contents of a post is not actually in wp_posts post_content field, but rather stored in wp_postmeta, linked by post_id.

    Secondly, it seems the plugin is firing too soon. It seems that the custom theme does not actually input the content into wp_postmeta until sometime AFTER the transition_post_status is invoked, so even if I replace the_excerpt() with get_post_meta(get_the_ID(), 'content', true), I still cannot retrieve any content (the email is still mostly blank with just post title) because at the time when subscribe-by-email.php is executing process_instant_notification, the related content row in wp_postmeta is still empty.

    I *think* the best way to do this may be to make the plugin invoke process_instant_notification in subscribe-by-email.php about 3 minutes AFTER a post has been published. Can you please tell me how I can modify subscribe-by-email.php to do so?

    Thanks

  • Vinod Dalvi

    Hi @DjHRIS,

    Thank you for your detailed reply.

    Before it gets to the_content($content) function, the actual $content array that is passed into the function, as generated by Line 408
    $user_content = $this->content_generator->filter_user_content( $key );

    is completely empty of post_excerpt and post_content.

    Make sure the post contains content in it.

    I have investigated it for some time and I found that the plugin is significantly conflicting with the custom theme that we are using.

    Can you just use default WordPress theme like Twenty Twelve to make to make sure that it is your theme that is conflicting with it?

    If it is not working only with your theme then try deactivating all plugins except "Subscribe by Email" to make sure that it is only the theme that is conflicting.

    Regards,
    Vinod Dalvi

  • Vinod Dalvi

    Hi @DjHRIS,

    Sorry for the late reply, I was away at a WordCamp event this weekend. Lets see if we can get you sorted. :slight_smile:

    The function process_instant_subscriptions is called from action hook transition_post_status in the following plugin file on line number 52

    plugins/subscribe-by-email/subscribe-by-email.php

    To delay the execution of this function, just increase the priority of this hook from 2 to 99 as following.

    add_action( 'transition_post_status', array( &$this, 'process_instant_subscriptions' ), 99, 3);

    Cheers,
    Vinod Dalvi

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.