How to send an email when the content is unpublished?
hook_scheduler_api() accepts two parameters - 

1. $node is the node object being processed
2. $action is either 'publish' or 'unpublish'


hook_scheduler_api()

&lt;?php
    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-&gt;mail, etc depending on your needs);
  }
}
?&gt;


hook_mail()

&lt;?php

function yourmodule_mail($key, &amp;$message, $params) {
  switch ($key) {
    case 'this-mail-key':
      $message['subject'] .= 'your subject';
      $message['body'][] = 'text';
      // etc ...
      break;
    // etc ...
}
?&gt;