Category How To

Action: postie_session_start

This action gets called at the beginning of each Postie session. I.e. when Postie starts the process to check for emails and turn them into posts. add_action(‘postie_session_start’, ‘my_postie_session_start_action’); function my_postie_session_start_action() { //get ready to process a bunch of emails }

postie_log_* Actions

postie_log_error & postie_log_debug These filters are called when Postie has some information about what is happening. postie_log_error is called if Postie encounters an error reported by WordPress. postie_log_debug is called throughout the Postie process when something of interest occurs. add_action(‘postie_log_error’,…

Action: postie_comment_after

This filter is called just after the comment is added to the post. Parameters: $comment – an array that represents the comment. See this for more information about the data in the $comment array. $comment_ID – the id of the comment.…

Filter: postie_comment_before

This filter is called just before the comment is added to the post. See this for more information about the data in the $comment array. add_filter(‘postie_comment_before’, ‘my_postie_comment_before’); function my_postie_comment_before($comment) { $post = get_post($comment[‘comment_post_ID’]); $title = $post->post_title; echo “postie_comment_before called<br>\n”; return…

Filter: postie_gallery

This filter is called when Postie inserts a gallery shortcode into the post (which only ever happens if the “Automatically insert image gallery” setting is turned on). You can use this filter to generate an alternate gallery shortcode. At the point…

Action: postie_file_added

This action is called after Postie successfully extracts an email attachment and adds it as a media item to the post. At the point it is called there is only a placeholder post, e.g. the content and metadata is not set…

Adding your own Postie shortcodes

The Postie Shortcodes AddOn allows you to create your own shortcodes that Postie will use when turning your email into a post. Not a programmer? I do custom development and can help you. Contact me Step one is to register…

Action: postie_post_after

This action is called just after Postie saves the post. At the point the action is called the post has been created and all attachments have been uploaded and associated with this post. There is one parameter to this filter: $post The $post parameter is…

Filter: postie_author

This filter is called after Postie has determined who the post author should be. At the point the filter is called there is no post created. The parameter is a WordPress user ID. add_filter(‘postie_author’, ‘my_filterAuthor’); function my_filterAuthor($userId) { //do some user…

Filter: postie_filter_email2

This filter is called when Postie extracts the “from” email address. Typically you would use this filter if you wanted to decide between the “from”, “to” and “reply-to” email addresses. At the point the filter is called there is no…