diff options
author | uckelman <uckelman@nomic.net> | 2010-04-20 19:21:03 +0000 |
---|---|---|
committer | uckelman <uckelman@nomic.net> | 2010-04-20 19:21:03 +0000 |
commit | 66ed9441658a9a5100ec78b82af19c6127a56575 (patch) | |
tree | e59b84ed7b1398a5e55d30ef8f6da86db21581e2 /src | |
parent | 8ea87f4df8958f9f0a88910a795936bddaf7a1fe (diff) |
* Don't sent HTML email.
* Append footer with backlink to post.
git-svn-id: https://vassalengine.svn.sourceforge.net/svnroot/vassalengine/site-src/trunk@6720 67b53d14-2c14-4ace-a08f-0dab2b34000c
Diffstat (limited to 'src')
-rw-r--r-- | src/F2M.php | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/src/F2M.php b/src/F2M.php index d06a2ec..a3f30a5 100644 --- a/src/F2M.php +++ b/src/F2M.php @@ -7,23 +7,17 @@ catch (Exception $e) { trigger_error($e, E_USER_ERROR); } -# TODO: wrap long lines # TODO: handle attachments function send_to_lists($user, $mode, $data, $post_data) { -/* print '<p>'; var_dump($data); var_dump($post_data); print '</p>'; -*/ - - set_include_path(get_include_path() . PATH_SEPARATOR . __DIR__ . '/..'); - require_once('HTML/BBCodeParser.php'); require_once('Mail.php'); - require_once('Mail/mime.php'); +# require_once('Mail/mime.php'); require_once(__DIR__ . '/Bridge.php'); require_once(__DIR__ . '/PhpBB3.php'); @@ -83,9 +77,9 @@ function send_to_lists($user, $mode, $data, $post_data) { 'Date' => $date, 'Message-Id' => $messageId, 'X-BeenThere' => $forumURL, -# 'Content-Type' => 'text/plain; charset=UTF-8; format=flowed', -# 'MIME-Version' => '1.0', -# 'Conten-Transfer-Encoding' => '8bit' + 'Content-Type' => 'text/plain; charset=UTF-8; format=flowed', + 'MIME-Version' => '1.0', + 'Conten-Transfer-Encoding' => '8bit' ); if ($inReplyTo !== null) { @@ -100,8 +94,22 @@ function send_to_lists($user, $mode, $data, $post_data) { $text = $data['message']; strip_bbcode($text, $data['bbcode_uid']); $text = htmlspecialchars_decode($text); - $text = wordwrap($text); + $text = wordwrap($text, 72); + + # Add the bridge footer + $postURL = "$forumURL/viewtopic.php?p=$postId#p$postId"; + + $footer = <<<EOF + +_______________________________________________ +Read this topic online here: +$postURL +EOF; + + $body = $text . $footer; + +/* $msg = $data['message']; $msg = nl2br($msg); $msg = str_replace(':' . $data['bbcode_uid'], '', $msg); @@ -124,6 +132,7 @@ function send_to_lists($user, $mode, $data, $post_data) { )); $headers = $mime->headers($headers); +*/ $mailer = Mail::factory('sendmail'); |