Just putting my feelers out on this one, I need to be able to accept incoming emails and add them as posts, however I want to be able to do a bit of processing first, for example I want to change the slug, prepend a string to the title etc.
Is there a way I can hook into the email function, change some data and then let it continue. I also might want to reject the email if it isn't sent from an approved domain (this will be a field in a custom post type).
Are my requirements achievable or am I barking up the wrong tree?
I have discovered the
save_post hook, although it fires after the post has saved... not really what I'm looking for. Is there a hook that gets fired before a post is saved, giving me all the info about the post, especially where it's been created from.
Alternatively is there a way to add a post manually... so I handle the receiving of the email with my own code + cron, then have an API to create a new post with?