You are here

function theme_subscriptions_mail_item_body in Subscriptions 5

themes an outgoing subscriptions mail

1 theme call to theme_subscriptions_mail_item_body()
subscriptions_mailvars in ./subscriptions.module

File

./subscriptions.module, line 1563

Code

function theme_subscriptions_mail_item_body($to_user, $from_addr, $strtype, $node, $cid, $page, $teaser) {
  static $subjects;
  if ($cid && !isset($subjects[$cid])) {
    $subjects[$cid] = db_result(db_query('SELECT subject FROM {comments} WHERE cid = %d', $cid));
  }
  $body = t(variable_get('subscriptions_email_body', SUBSCRIPTIONS_DEFAULT_BODY), array(
    '@name' => $to_user->name,
    '@type' => t($strtype),
    '!url' => url('node/' . $node->nid, $page ? $page : NULL, $cid ? "comment-{$cid}" : NULL, 1),
    '@site' => t(variable_get('site_name', 'drupal')),
    '!manage-url' => variable_get('subscriptions_usersmenu', 1) ? url('user/' . $to_user->uid . '/subscriptions', NULL, NULL, 1) : url('subscriptions', NULL, NULL, 1),
    '@title' => $node->title . ($cid ? "\n\n" . $subjects[$cid] : ''),
    '@teaser' => strip_tags($teaser),
  ));
  return $body;
}