More enhacements to wp-mail.php
Well, its time to start another day. Your day can’t be all bad if you can add some features to a product before work begins. How about some new enhancements to the wp-mail.php file in the wordpress software? One feature that was missing was the ability to specify a category for your e-mailed post to find its way into. Currently there is just one global category setting, and all email posts find their way there. I didn’t like this, so I added the ability to put Name/Value pairs into an email. The pairs currently available are Category and Post Status. Category can be any category in the system while Post Status can be Draft, Publish, or Private (as defined buy WordPress. All name/value pairs can be entered like this.
Name:Value
You should be able to add these anywhere in the message, but I would suggest putting them at the top.
Additionally a few more bugs have been fixed (you can now put ‘ characters in your subject line). To download a copy of the current revisions, use the same link as before (https://www.cmagic.biz/wordpress/wp-mail.zip).
How does it work? Well, its actually quite simple. After we have extracted the message body, we can process it a bit before too much else is done. At this point we can ask to retreive values from the body by using the GetPostValue function. This will scan the body looking for the specified name/value pair, and extract them from the body (it actually takes that line out so it won’t show up in the post). Using this, we can add as many options to the script as WordPress allows. I’ve done enough for the last few days on this, if some one wants to pick it up from here, go for it. The link above is a zipped copy of the current wp-mail.php file. Kindly send me a note letting me know if the changes were usefull though.
Ray Pulsipher
Owner
Computer Magic And Software Design