Beispiel #1
0
 /**
  * build main content of a message
  *
  * Note: this function returns legacy HTML, not modern XHTML, because this is what most
  * e-mail client software can afford.
  *
  * @param string headline
  * @param string main content
  * @return string text to be send by e-mail
  */
 public static function build_mail_content($headline, $content = '')
 {
     global $context;
     // start the notification
     $text = '';
     // the illustrated headline
     if ($headline) {
         // insert poster image, if possible
         if ($url = Surfer::get_avatar_url()) {
             $text .= '<table border="0" cellpadding="0" cellspacing="0" width="100%">' . '<tr valign="middle">' . '<td align="left" valign="middle" width="9%"><img src="' . $url . '" alt="" title="avatar"></td>' . '<td width="1%"> </td>' . '<td align="left" valign="middle" width="90%">' . '<font face="Helvetica, Arial, sans-serif" color="navy" size="+1">' . $headline . '</font>' . '</td>' . '</tr>' . '</table>';
         } else {
             $text .= '<table border="0" cellpadding="0" cellspacing="0" width="100%">' . '<tr valign="middle">' . '<td align="left" valign="middle" width="100%">' . '<font face="Helvetica, Arial, sans-serif" color="navy" size="+1">' . $headline . '</font>' . '</td>' . '</tr>' . '</table>';
         }
     }
     // the full content
     if ($content) {
         $text .= '<table border="0" cellpadding="0" cellspacing="0" width="100%">' . '<tr valign="top">' . '<td align="left" valign="top" width="100%">' . '<div style="border-left: solid 2px #ccc; padding: 10px 0 10px 10px; margin: 20px 0;">' . '<font face="Helvetica, Arial, sans-serif" color="navy">' . $content . '</font>' . '</div>' . '</td>' . '</tr>' . '</table>';
     }
     // the full message
     return $text;
 }