aboutsummaryrefslogtreecommitdiffstats
path: root/mod/item.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-01-31 18:18:28 -0800
committerFriendika <info@friendika.com>2011-01-31 18:18:28 -0800
commit8965db24ccb0793daebd37adc25e769e52492565 (patch)
tree92b3354126c9b77ad26dc85b72b7e62b5b33f5de /mod/item.php
parent082909fe1a861219c4f9159f8f8df5aea7546da9 (diff)
downloadvolse-hubzilla-8965db24ccb0793daebd37adc25e769e52492565.tar.gz
volse-hubzilla-8965db24ccb0793daebd37adc25e769e52492565.tar.bz2
volse-hubzilla-8965db24ccb0793daebd37adc25e769e52492565.zip
post to email recips (backend)
Diffstat (limited to 'mod/item.php')
-rw-r--r--mod/item.php31
1 files changed, 29 insertions, 2 deletions
diff --git a/mod/item.php b/mod/item.php
index cc1886c17..7125ae1f4 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -422,12 +422,39 @@ function item_post(&$a) {
logger('mod_item: notifier invoked: ' . "\"$php_path\" \"include/notifier.php\" \"$notify_type\" \"$post_id\" &");
- proc_run($php_path, "include/notifier.php", $notify_type, "$post_id");
+ proc_run($php_path, "include/notifier.php", $notify_type, "$post_id");
$datarray['id'] = $post_id;
call_hooks('post_local_end', $datarray);
-
+
+ if(strlen($emailcc) && $profile_uid == local_user()) {
+ $erecips = explode(',', $emailcc);
+ if(count($erecips)) {
+ foreach($erecips as $recip) {
+ $addr = trim($recip);
+ if(! strlen($addr))
+ continue;
+ $disclaimer = '<hr />' . t('This message was sent to you by ') . $a->user['username']
+ . t(', a member of the Friendika social network.') . '<br />';
+ $disclaimer .= t('You may visit them online at') . ' '
+ . $a->get_baseurl() . '/profile/' . $a->user['nickname'] . '<br />';
+ $disclaimer .= t('Please contact the sender by replying to this post if you do not wish to receive these messages.') . '<br />';
+
+ $subject = '[Friendika]' . ' ' . $a->user['username'] . ' ' . t('posted an update.');
+ $headers = 'From: ' . $a->user['username'] . ' <' . $a->user['email'] . '>' . "\n";
+ $headers .= 'MIME-Version: 1.0' . "\n";
+ $headers .= 'Content-Type: text/html; charset=UTF-8' . "\n";
+ $headers .= 'Content-Transfer-Encoding: 8bit' . "\n\n";
+ $link = '<a href="' . $a->get_baseurl() . '/profile/' . $a->user['nickname'] . '"><img src="' . $author['thumb'] . '" alt="' . $a->user['username'] . '" /></a><br /><br />';
+ $html = prepare_body($datarray);
+ $message = '<html><body>' . $link . $html . $disclaimer . '</body></html>';
+ @mail($addr, $subject, $message, $headers);
+ }
+ }
+ }
+
+
goaway($a->get_baseurl() . "/" . $_POST['return'] );
return; // NOTREACHED