email styling

This commit is contained in:
Alexander Yakovlev 2017-05-05 16:51:40 +07:00
parent e44825cef3
commit c040268228

View file

@ -2,6 +2,8 @@
// forbidden: forbidden forums IDs
// skips over threads made by this user with 0 replies
function print_email($username, $unsubscription, $threads, $forbidden) {
$th_style = "padding: 0.5em; border: 1px solid #eee;";
$td_style = "padding: 0.5em; border: 1px solid #eee;";
$message = <<<END
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
@ -14,13 +16,13 @@ function print_email($username, $unsubscription, $threads, $forbidden) {
<p>Heres a daily update of activity on the Olympic Business forum.</p>
<p><table style="padding: 1em; border: 1px solid #222;">
<p><table style="padding: 1em; border: 1px solid #eee;border-collapse: collapse;">
<thead>
<th style="padding: 0.5em">Forum</th>
<th style="padding: 0.5em">Thread</th>
<th style="padding: 0.5em">Started by</th>
<th style="padding: 0.5em">Replies</th>
<th style="padding: 0.5em">Last update</th>
<th style="$th_style">Forum</th>
<th style="$th_style">Thread</th>
<th style="$th_style">Started by</th>
<th style="$th_style">Replies</th>
<th style="$th_style">Last update</th>
</thead>
<tbody>
END;
@ -31,14 +33,14 @@ END;
continue;
$message .= '
<tr>
<td style="padding: 0.5em">'.$thread['forumname'].'</td>
<td style="padding: 0.5em">'.$thread['subject'].'</td>
<td style="padding: 0.5em">'.
<td style="'.$td_style.'">'.$thread['forumname'].'</td>
<td style="'.$td_style.'">'.$thread['subject'].'</td>
<td style="'.$td_style.'">'.
$thread['username'].', '.
date(DATE_FORMAT, $thread['dateline']).'
</td>
<td style="padding: 0.5em">'.$thread['replies'].'</td>
<td style="padding: 0.5em">'.
<td style="'.$td_style.'">'.$thread['replies'].'</td>
<td style="'.$td_style.'">'.
$thread['lastposter'].', '.
date(DATE_FORMAT, $thread['lastpost']).'
</td>