This repository has been archived on 2024-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
mybb-digest/email.php

58 lines
1.8 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
// forbidden: forbidden forums IDs
function print_email($username, $unsubscription, $threads, $forbidden) {
$message = <<<END
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<head>
<title>Daily digest from Olympic Business Forum</title>
</head>
<body style="font-family: Arial, Helvetica, sans-serif;font-size: 11pt;">
<p>$username,</p>
<p>Heres a daily update of activity on the Olympic Business forum.</p>
<p><table style="padding: 1em">
<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>
</thead>
<tbody>
END;
foreach ($threads as $thread) {
if (in_array($thread['fid'], $forbidden))
continue;
$message .= '
<tr>
<td style="padding: 0.5em">'.$thread['forumname'].'</td>
<td style="padding: 0.5em">'.$thread['subject'].'</td>
<td style="padding: 0.5em">'.
$thread['username'].', '.
date(DATE_FORMAT, $thread['dateline']).'
</td>
<td style="padding: 0.5em">'.$thread['replies'].'</td>
<td style="padding: 0.5em">'.
$thread['lastposter'].', '.
date(DATE_FORMAT, $thread['lastpost']).'
</td>
</tr>
';
}
$message .= <<<END
</tbody>
</table></p>
<p>Thank you,<br>
Olympic Business Forum Staff</p>
<p>To unsubscribe from these daily digests, click here: <a href="$unsubscription">$unsubscription</a></p>
</body>
</html>
END;
return $message;
} ?>