You are here

function _notify_content in Notify 5

Same name and namespace in other branches
  1. 8 notify.module \_notify_content()
  2. 5.2 notify.module \_notify_content()
  3. 6 notify.module \_notify_content()
  4. 7 notify.module \_notify_content()
  5. 1.0.x notify.module \_notify_content()

Formatting of outgoing mail, taken from mail.inc, part of project.module

1 call to _notify_content()
_notify_send in ./notify.module
Helper function to send the notification email.

File

./notify.module, line 303

Code

function _notify_content($node, $notify) {
  static $i = 0;
  switch ($notify->teasers) {
    case 0:
      return;
    case 1:
      $txt = check_markup($node->teaser, $node->format, FALSE);
      break;
    case 2:
      $txt = check_markup($node->body, $node->format, FALSE);
  }
  $pattern = '@(<a href="(.+?)">(.+?)</a>)@ei';
  $txt = preg_replace($pattern, "'\\3 ['. _notify_mail_urls('\\2') .']'", $txt);
  $urls = _notify_mail_urls();
  if (count($urls)) {
    $txt .= "\n";
    for ($max = count($urls); $i < $max; $i++) {
      $txt .= '[' . ($i + 1) . '] ' . $urls[$i] . "\n";
    }
  }
  $txt = strip_tags($txt);
  $txt = notify_entities_to_utf8($txt);
  return wordwrap($txt, 72);
}