Created
March 30, 2012 03:16
-
-
Save evolvingweb/2246159 to your computer and use it in GitHub Desktop.
hook_node_insert()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Implements hook_node_insert() | |
* | |
* Sends an email when a node is added | |
*/ | |
function mail_node_insert($node) { | |
if ($node->type == "blog") { | |
mail('[email protected]', 'Blog Updated', | |
'Link: http://example.com/node/' . $node->nid); | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment