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 ?
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;
}
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;
}