• Resolved kabut

    (@kabut)


    Hello i have problems with postie. I want to post a email like:


    DATE:xx-xx-xxxx
    PLACE:xxxxxxxxxxxxxxxxxxxxxxx

    but postie takes the date and schedule my post for a future time. How can i set postie to dont process the dates and just print them in posts?

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

    (@wayneallen-1)

    Unfortunately at this time “date:” is special to Postie. Switching to “WHEN: xx-xx-xx” is one way of solving the issue. Or you can leave off the colon. “DATE xx-xx-xx”

    Thread Starter kabut

    (@kabut)

    Thank you for your answer. 🙂 To clarify, they are auto mails from a news system so i cant edit the messages (luckly the broken ones are 1 percent of the emails). As i understand is there a way to change “date” indicator to “when” in postie ?

    Plugin Author Wayne Allen

    (@wayneallen-1)

    You are correct. One option would be to hook postie_post_pre and replace the DATE: with WHEN:

    See http://postieplugin.com/extending/ and http://postieplugin.com/filter-postie_post_pre/

    Thread Starter kabut

    (@kabut)

    I tried something but i am really far far away to this topic 🙁 . $DATE:=’WHEN:’

    something like that. did you mean ?

    function my_postie_post_function($post) {
    //do something here like update $post[‘post_content’]
    return $post;
    }

    add_filter(‘postie_post_pre’, ‘my_postie_post_pre’);

    function my_postie_post_pre($email) {
    $DATE:=’WHEN:’
    $email[‘headers’][‘subject’] .= ‘ processed by postie_post_pre’;
    return $email;
    }

    Plugin Author Wayne Allen

    (@wayneallen-1)

    Try this:

    <?php
    
    add_filter('postie_post_pre', 'my_postie_post_pre');
    
    function my_postie_post_pre($email) {
        $email['text'] = str_replace('DATE:', 'WHEN:', $email['text']);
        $email['html'] = str_replace('DATE:', 'WHEN:', $email['html']);
        $email['headers']['subject'] .= ' processed by postie_post_pre';
        return $email;
    }
    
Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Postie disabling date proccess’ is closed to new replies.