Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Wayne Allen

    (@wayneallen-1)

    Removing the Mailchimp footer and retaining the HTML structure is something you’d need to do through a custom addon. See http://postieplugin.com/extending/

    Thread Starter SunflowerSchool

    (@sunflowerschool)

    Hi

    Thanks for the response. Problem is that there are no examples. I am looking in the postie-functions.php and I see the Filter_End function but since PHP is a mystery to me, I am not sure where to start.

    Could you throw some examples my way?

    Plugin Author Wayne Allen

    (@wayneallen-1)

    What you are asking for is non-trivial and unlikely to be successful via cut and paste coding. You need to consider finding someone who knows PHP to assist you.

    Thread Starter SunflowerSchool

    (@sunflowerschool)

    Hi Wayne
    Thanks for taking time to respond. Postie is a wonderful plugin.
    All I really need help with is getting Postie to read my code at the right time. It must either strip the footer when reading the mail or it must strip the footer when creating the post.

    I don’t know how to hook into either of those events or create a filter.

    If you have to give me a pointer I would appreciate that. If not, I do understand that this is not a priority.

    The code for stripping off the footer is easy enough.
    <?php
    $str = <<<EOD
    in here I place the full email
    spanning as many
    lines as it
    needs

    EOD;
    echo (strstr ($str, “<center>”, true)); //* gives back everything before “<center>”

    I use the heredoc method to quote the string as it can have many ‘ and ” and I don’t want to evaluate them.

    The problem is, I can’t find the message as string at any point. It seems to be an object most of the time.

    Plugin Author Wayne Allen

    (@wayneallen-1)

    This is the filter you want: http://postieplugin.com/postie_post_before/

    There is an example on the page. The $post variable is an array with the contents in $post[‘post_content’]. You need to do something like:

    add_filter('postie_post_before', 'my_postie_post_before');
    
    function my_postie_post_before($post) {
        $post['post_content'] = mymagicfunctiontoremovethefooter($post['post_content']);
        return $post;
    }
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Stripping off Mailchimp Footer’ is closed to new replies.