View Single Post
Old 08-17-2007, 02:31 PM   #69 (permalink)
Dan.Linehan
Senior Member
 
Join Date: Oct 2006
Location: San Rafael, CA
Posts: 4,894
Dan.Linehan is on a distinguished road
Default

I went through the tutorial here and created a plugin that e-mails me when I publish a new wordpress post, using the publish_post hook we talked about.

Here is the code.

Code:
<?php

/*
Plugin Name: Email Friends
Plugin URL: http://stevepavlina.com/forums
Description: This plugin will e-mail Dan at his yahoo account when a new post is published.
Author: Dan Linehan
Version: 1
Author URL: http://bestconsultingever.com
*/ 

function email_friends($post_ID)  {
    $friends = 'puredemo@yahoo.com';
    mail($friends,"Dan's blog updated",'I just put something on my blog: ~http://blog.example.com');
    return $post_ID;
}

add_action('publish_post','email_friends');

?>
You can save this code as a .php file, drag it into your plugins and activate it, just like any other plugin.

Working on a function that will post to SMF instead of emailing.
__________________

Best,
Dan Linehan

For web development & design: Etopolos
| Facebook
Dan.Linehan is offline   Reply With Quote