summaryrefslogtreecommitdiff
path: root/lib/mail.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2008-10-04 11:44:54 -0400
committerEvan Prodromou <evan@controlyourself.ca>2008-10-04 11:44:54 -0400
commitfa2d50f481cda7b430c627cee04a81b8b2703bd7 (patch)
treecded35d0d23ef5af58365d336e2d6c0b3336a7df /lib/mail.php
parent76db0310acf18e0d055e8cff9eb144a59ff76966 (diff)
move fave notification to mail library
darcs-hash:20081004154454-5ed1f-6b5b66945d415690f4cac5e66c1edad71ec031a5.gz
Diffstat (limited to 'lib/mail.php')
-rw-r--r--lib/mail.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/mail.php b/lib/mail.php
index 827e48e81..b6ce1fe22 100644
--- a/lib/mail.php
+++ b/lib/mail.php
@@ -267,3 +267,24 @@ function mail_notify_message($message, $from=NULL, $to=NULL) {
return mail_to_user($to, $subject, $body);
}
+
+function mail_notify_fave($other, $user, $notice) {
+ $profile = $user->getProfile();
+ $bestname = $profile->getBestName();
+ $subject = sprintf(_('%s added your notice as a favorite'), $bestname);
+ $body = sprintf(_("%1\$s just added your notice from %2\$s as one of their favorites.\n\n" .
+ "In case you forgot, you can see the text of your notice here:\n\n" .
+ "%3\$s\n\n" .
+ "You can see the list of %1\$s's favorites here:\n\n" .
+ "%4\$s\n\n" .
+ "Faithfully yours,\n" .
+ "%5\$s\n"),
+ $bestname,
+ common_exact_date($notice->created),
+ common_local_url('shownotice', array('notice' => $notice->id)),
+ common_local_url('showfavorites', array('nickname' => $user->nickname)),
+ common_config('site', 'name'));
+
+ mail_to_user($other, $subject, $body);
+}
+ \ No newline at end of file