You are here

function protected_node_mail in Protected Node 7

Same name and namespace in other branches
  1. 6 protected_node.mail.inc \protected_node_mail()
  2. 1.0.x protected_node.mail.inc \protected_node_mail()

Implements hook_mail().

This is the function that builds the actual message body.

File

./protected_node.mail.inc, line 45
Protected Node mail handling.

Code

function protected_node_mail($key, &$message, $params) {
  $node = $params['node'];
  switch ($key) {
    case 'password':
      module_load_include('settings.inc', 'protected_node');
      $subject = variable_get('protected_node_email_subject', protected_node_email_subject());
      $subject = token_replace($subject, array(
        'node' => $node,
      ));
      $message['subject'] = $subject;
      $body = variable_get('protected_node_email_body', protected_node_email_body());
      $body = token_replace($body, array(
        'node' => $node,
      ));
      $message['body'][] = $body;
      break;
  }
}