• Please excuse the noobishness of the questions, I’m way out of my depth.

    I’m attempting to have a newsletter send automatically daily, with only a single post in the automatic content. However, I would also like the post excerpt in the body above the automatic content. I attempted to use the instuctions on http://beta.docs.mailpoet.com/article/160-create-your-own-custom-shortcode, but got lost

    I added

    add_filter(‘mailpoet_newsletter_shortcode’, ‘mailpoet_custom_shortcode’, 10, 5);
    function mailpoet_custom_shortcode($shortcode, $newsletter, $subscriber, $queue, $newsletter_body) {
    // always return the shortcode if it doesn’t match your own
    if ($shortcode !== ‘[custom:excerpt]’) return $shortcode;

    $excerpt = get_the_excerpt($post);

    return $excerpt;
    }

    this returns “excerpt” as a string, as opposed to the full excerpt string, if that makes sense. I think this is the expected error functionality, but it’s obviously not what I’m after.

    Any help to pull out the actual excerpt would be greatly appreciated.

Viewing 2 replies - 1 through 2 (of 2 total)
  • First of all, you’ve tried to create a shortcode for MailPoet 3. Are you using MailPoet 3 or MailPoet 2.7.10? Because this forum is for MailPoet 2 questions only. If you are using MailPoet 3, post your question here please: https://wordpress.org/support/plugin/mailpoet

    Thread Starter hutchie91

    (@hutchie91)

    I am using 2.7.10, but following the other documentation didn’t achieve anything, whereas using the Mailpoet 3 documentation at least got me something working.

    Looks like I’m in even further over my head than I thought…

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Add excerpt text separate from Automatic Content’ is closed to new replies.