aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--actions/comments/add.php13
-rw-r--r--engine/lib/notification.php2
-rw-r--r--languages/en.php23
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