From: Tobias Diekershoff Date: Sat, 16 Feb 2013 10:03:46 +0000 (+0100) Subject: use entry title (if set) as subject when send by email X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=77bc4cd0dc165a1bcdf7edf60a0b4b144a8fc93a;p=friendica.git use entry title (if set) as subject when send by email --- diff --git a/mod/item.php b/mod/item.php index 612ac3a3c8..d04ab71dea 100644 --- a/mod/item.php +++ b/mod/item.php @@ -867,8 +867,11 @@ function item_post(&$a) { . '
'; $disclaimer .= sprintf( t('You may visit them online at %s'), $a->get_baseurl() . '/profile/' . $a->user['nickname']) . EOL; $disclaimer .= t('Please contact the sender by replying to this post if you do not wish to receive these messages.') . EOL; - - $subject = email_header_encode('[Friendica]' . ' ' . sprintf( t('%s posted an update.'),$a->user['username']),'UTF-8'); + if (!$datarray['title']=='') { + $subject = email_header_encode($datarray['title'],'UTF-8'); + } else { + $subject = email_header_encode('[Friendica]' . ' ' . sprintf( t('%s posted an update.'),$a->user['username']),'UTF-8'); + } $headers = 'From: ' . email_header_encode($a->user['username'],'UTF-8') . ' <' . $a->user['email'] . '>' . "\n"; $headers .= 'MIME-Version: 1.0' . "\n"; $headers .= 'Content-Type: text/html; charset=UTF-8' . "\n"; @@ -876,7 +879,7 @@ function item_post(&$a) { $link = '' . $a->user['username'] . '

'; $html = prepare_body($datarray); $message = '' . $link . $html . $disclaimer . ''; - @mail($addr, $subject, $message, $headers); + @mail($addr, $subject, $message, $headers); } } }