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 Normal View History

2017-05-04 09:39:07 +03:00
<?php
2017-05-04 15:29:29 +03:00
// forbidden: forbidden forums IDs
function print_email($username, $unsubscription, $threads, $forbidden) {
2017-05-04 12:16:16 +03:00
$message = <<<END
2017-05-04 09:39:07 +03:00
<!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>
2017-05-04 15:03:34 +03:00
<body style="font-family: Arial, Helvetica, sans-serif;font-size: 11pt;">
2017-05-04 12:16:16 +03:00
<p>$username,</p>
2017-05-04 09:39:07 +03:00
<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>
2017-05-04 10:12:32 +03:00
<th style="padding: 0.5em">Replies</th>
2017-05-04 09:39:07 +03:00
<th style="padding: 0.5em">Last update</th>
</thead>
<tbody>
2017-05-04 12:16:16 +03:00
END;
foreach ($threads as $thread) {
2017-05-04 15:29:29 +03:00
if (in_array($thread['fid'], $forbidden))
continue;
2017-05-04 12:16:16 +03:00
$message .= '
2017-05-04 09:39:07 +03:00
<tr>
2017-05-04 12:16:16 +03:00
<td style="padding: 0.5em">'.$thread['forumname'].'</td>
<td style="padding: 0.5em">'.$thread['subject'].'</td>
<td style="padding: 0.5em">'.
$thread['username'].', '.
2017-05-04 15:03:34 +03:00
date(DATE_FORMAT, $thread['dateline']).'
2017-05-04 09:39:07 +03:00
</td>
2017-05-04 12:16:16 +03:00
<td style="padding: 0.5em">'.$thread['replies'].'</td>
<td style="padding: 0.5em">'.
$thread['lastposter'].', '.
2017-05-04 15:03:34 +03:00
date(DATE_FORMAT, $thread['lastpost']).'
2017-05-04 09:39:07 +03:00
</td>
</tr>
2017-05-04 12:16:16 +03:00
';
}
$message .= <<<END
2017-05-04 09:39:07 +03:00
</tbody>
</table></p>
<p>Thank you,<br>
Olympic Business Forum Staff</p>
2017-05-04 12:16:16 +03:00
<p>To unsubscribe from these daily digests, click here: <a href="$unsubscription">$unsubscription</a></p>
2017-05-04 09:39:07 +03:00
</body>
</html>
2017-05-04 12:16:16 +03:00
END;
return $message;
} ?>