Support » Plugins » Post by mail – linking multiple emails to specific categories

  • Resolved JonasNielsen


    Hi all,

    I’m getting started with WordPress 3, and I really enjoy it.

    I’m stuck with this problem:
    The post by mail really looks useful. Because I have different user groups on my site managing different categories, I would really like to have the option to monitor different email addresses.
    So for instance
    Managers can email and post to managers category
    assistants can email and post to assistants category

    Is that somehow possible? Is there perhaps an existing plugin that supports this?

    If not, would you consider it impossible to implement? If I’m not able to code it myself I would presumably be willing to pay for it.

Viewing 1 replies (of 1 total)
  • Ok, I actually managed to solve this problem with a kinda hack.

    Googling some more, I discovered the Postie plugin

    This plugin lets you customize the post by mail a lot, but what I found really interesting, was that it also comes with a Postie Filter plugin. Basically, this is just a file that lets you program custom filters that is applied to incoming mails.

    By using this approach, I was able to program a very short script, that alters the author id and category id of the post, according to the author of the email.

    If the email author is not recognized as one of the manually programmed emails, the post will be moved to the trash folder.

    Following is an example of the content inside filterPostie.php

    function filter_category($post){
    	if($post['email_author'] == $VICEVAERT_EMAIL){
    		$post['post_category'][0] = $VICEVAERT_CATEGORY_ID;
    		$post['post_author'] = $VICEVAERT_USER_ID;
    	else if($post['email_author'] == $BESTYRELSEN_EMAIL){
    		$post['post_category'][0] = $BESTYRELSEN_CATEGORY_ID;
    		$post['post_author'] = $BESTYRELSEN_USER_ID;
    	else if($post['email_author'] == $AKTIVITETSUDVALGET_EMAIL){
    		$post['post_category'][0] = $AKTIVITETSUDVALGET_CATEGORY_ID;
    		$post['post_author'] = $AKTIVITETSUDVALGET_USER_ID;
    	else {
    		$post['post_status'] = 'trash';
      	return ($post);
    add_filter('postie_post', 'filter_category');

Viewing 1 replies (of 1 total)
  • The topic ‘Post by mail – linking multiple emails to specific categories’ is closed to new replies.