summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--comment_notify.module26
1 files changed, 8 insertions, 18 deletions
diff --git a/comment_notify.module b/comment_notify.module
index 3e17b1a..c820042 100644
--- a/comment_notify.module
+++ b/comment_notify.module
@@ -399,6 +399,7 @@ function _comment_notify_mailalert($comment) {
global $language;
global $base_url;
global $user;
+ $initial_language = $language;
$nid = $comment->nid;
$cid = $comment->cid;
@@ -410,13 +411,6 @@ function _comment_notify_mailalert($comment) {
return;
}
- $initial_language = $language;
-
- if (function_exists('locale')) {
- $languages = locale_language_list();
- $languages = $languages['name'];
- }
-
$node = node_load($nid);
// No mails if this is not an enabled content type.
@@ -493,10 +487,6 @@ function _comment_notify_mailalert($comment) {
$message[$k] = token_replace(t($v), array('comment' => $comment, 'node' => $node, 'user' => $user));
}
- // array(
- // '!link1' => url('comment_notify/disable/'. $alert->notify_hash, array('absolute' => TRUE))
- // )
-
drupal_mail('comment_notify', 'comment_notify_mail', $mail, $language, $message);
$sent_to[] = $mail;
@@ -511,15 +501,15 @@ function _comment_notify_mailalert($comment) {
// Add an entry to the watchdog log.
watchdog(
'comment_notify',
- 'Notified: !user_mail',
- array('!user_mail' => $user_mail),
- WATCHDOG_NOTICE,
- l(t('source comment'), 'node/' . $nid, array(
- 'fragment' => 'comment-' . $alert->cid,
- ))
+ 'Notified: @user_mail',
+ array('@user_mail' => $user_mail),
+ WATCHDOG_NOTICE,
+ l(t('source comment'), 'node/' . $nid, array(
+ 'fragment' => 'comment-' . $alert->cid,
+ ))
);
- // revert to previous (site default) locale
+ // Revert to previous (site default) locale.
$language = $initial_language;
}
}