diff options
author | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-07-08 12:28:11 +0000 |
---|---|---|
committer | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-07-08 12:28:11 +0000 |
commit | 5b3e80ec1722a083d35c20f60ed043951ebd4149 (patch) | |
tree | 8e728b21d1f2a0f9c7cb573e56b8089dcd627cad | |
parent | 08cb7d2a6c8256ff7963c90c9ba0d92b46a3e3b3 (diff) | |
download | elgg-5b3e80ec1722a083d35c20f60ed043951ebd4149.tar.gz elgg-5b3e80ec1722a083d35c20f60ed043951ebd4149.tar.bz2 |
Introducing notifications on generic comments.
git-svn-id: https://code.elgg.org/elgg/trunk@1336 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r-- | actions/comments/add.php | 13 | ||||
-rw-r--r-- | engine/lib/notification.php | 2 | ||||
-rw-r--r-- | languages/en.php | 23 |
3 files changed, 35 insertions, 3 deletions
diff --git a/actions/comments/add.php b/actions/comments/add.php index 4f3d5eee8..d89fd7866 100644 --- a/actions/comments/add.php +++ b/actions/comments/add.php @@ -23,6 +23,19 @@ // If posting the comment was successful, say so
if ($entity->annotate('generic_comment',$comment_text,$entity->access_id, $_SESSION['guid'])) {
+ if ($entity->owner_guid != $_SESSION['user']->getGUID())
+ notify_user($entity->owner_guid, $_SESSION['user']->getGUID(), elgg_echo('generic_comment:email:subject'),
+ sprintf(
+ elgg_echo('generic_comment:email:body'),
+ $entity->title,
+ $_SESSION['user']->name,
+ $comment_text,
+ $entity->getURL(),
+ $_SESSION['user']->name,
+ $_SESSION['user']->getURL()
+ )
+ );
+
system_message(elgg_echo("generic_comment:posted"));
} else {
diff --git a/engine/lib/notification.php b/engine/lib/notification.php index 1494c06e7..e711b8bc5 100644 --- a/engine/lib/notification.php +++ b/engine/lib/notification.php @@ -241,7 +241,7 @@ $headers = "From: $from\r\n"; - return mail($to, $subject, $message, $headers); + return mail($to, $subject, wordwrap($message), $headers); } /** diff --git a/languages/en.php b/languages/en.php index d4eaf32ef..a9b6fd95d 100644 --- a/languages/en.php +++ b/languages/en.php @@ -502,7 +502,9 @@ Alternatively, you can enter your database settings below and we will try and do 'friend:newfriend:subject' => "%s has made you a friend!", 'friend:newfriend:body' => "%s has made you a friend! -Check them out: %s +To view their profile, click here:
+
+ %s You cannot reply to this email.", @@ -542,7 +544,24 @@ Your password has been reset to: %s", 'generic_comment:blank' => "Sorry; you need to actually put something in your comment before we can save it.",
'generic_comment:notfound' => "Sorry; we could not find the specified item.",
'generic_comment:notdeleted' => "Sorry; we could not delete this comment.",
- 'generic_comment:failure' => "An unexpected error occurred when adding your comment. Please try again.", + 'generic_comment:failure' => "An unexpected error occurred when adding your comment. Please try again.",
+
+ 'generic_comment:email:subject' => 'You have a new comment!',
+ 'generic_comment:email:body' => "You have a new comment on your item \"%s\" from %s. It reads:
+
+
+%s
+
+
+To reply or view the original item, click here:
+
+ %s
+
+To view %s's profile, click here:
+
+ %s
+
+You cannot reply to this email.", /** * Languages according to ISO 639-1 |