Help Desk

Embed Mailpoet (formerly WYSIJA) forms into TEC custom fields

  • | Permalink

    I’m trying to assign a specific Mailpoet shortcode (Example: [wysija_form id=”1″]) to each event. I’ve created an “Additional Field” in TEC admin settings called “Newsletter.”

    I would like to add the Mailpoet shortcode in each event’s “Newsletter” field, but rather than display the newsletter subscription form, it displays the shortcode.

    This is the code I have in single-event.php

    <h3>Sign up for the <?php the_title(); ?> newsletter for the latest info, discounts + more!</h3>
    <?php echo tribe_get_custom_field(‘Newsletter’); ?>

    Posts: 3519 Answers: 115
    | Permalink
    Correct Answer

    Thanks for getting in touch! You should be able to do this by using the ‘do_shortcode()‘ function. Something like this:

    echo do_shortcode(  tribe_get_custom_field('Newsletter') );

    Try that and see if it does the trick! Thanks! 🙂


    | Permalink

    Hallelujah! Thanks for the help 🙂

    Posts: 3519 Answers: 115
    | Permalink

    Awesome! Thanks for confirming that this got you sorted. Since it looks like you’re all set, I’m going to mark this thread “Answered” and close it out.

    By the way, if you have a minute or two, we would love it if you’d write a few words for us here:

    Thanks in advance. 🙂