hook_scheduler_api() accepts two parameters -
1. $node is the node object being processed
2. $action is either 'publish' or 'unpublish'
hook_scheduler_api()
<?php
/**
* Implementation of hook_scheduler_api.
*
* @param $node
* The node object
* @param $action
* The action being performed, either "publish" or "unpublish"
*/
function yourmodule_scheduler_api($node, $action) {
if (some condition) {
// parameters: drupal_mail($module, $key, $to, $language, $params = array(), $from = NULL, $send = TRUE) {
drupal_mail('yourmodule', 'mail key', $user->mail, etc depending on your needs);
}
}
?>
<?php
/**
* Implementation of hook_mail().
*
* Constructs an email.
*
* @param $key
* Unique key to indicate what message to build.
* @param $message
* Reference to the message array being built.
* @param $params
* Array of parameters to indicate what kind of text to include in the
* message body.
*
*/
function yourmodule_mail($key, &$message, $params) {
switch ($key) {
case 'this-mail-key':
$message['subject'] .= 'your subject';
$message['body'][] = 'text';
// etc ...
break;
// etc ...
}
?>