<?php
/**
 * Description
 *
 * This file is part of the project codename "AMANUENSIS"
 *
 * @author Sebastian Antosch <s.antosch@i-san.de>
 * @copyright 2015 I-SAN.de Webdesign & Hosting GbR
 * @link http://i-san.de
 *
 * @license GPL
 */

?>
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title>
            <?= $subject ?>
        </title>
        <style type="text/css">
            html, body, table
            {
                height: 100%;
                min-height: 100%;
                padding: 0;
                margin: 0;
                font: 14px Arial, Helvetica, sans-serif;
                width: 100%;
                line-height: 1.5;
            }
            iframe
            {
                height: 100%;
                width: 100%;
                padding: 0;
                margin: 0;
            }
            .mailheader
            {
                position: fixed;
                top: 0;
                left: 0;
                right: 0;
                padding: 15px;
                height: 80px;
                background-color: #ffffff;
                box-shadow: 0 3px 3px rgba(0,0,0,0.3);
            }
            .main
            {
                padding-top: 110px;
                height: calc(100% - 115px);
                min-height: calc(100% - 115px);
            }
            .il-left
            {
                display: inline-block;
                width: 100px;
                font-weight: bold;
            }
            .il-right
            {
                display: inline-block;
            }
        </style>
    </head>
    <body>
        <div class="mailheader">
            <span class="il-left">Empf&auml;nger: </span><span class="il-right"><a href="mailto:<?= htmlentities($recipient['mail']) ?>"><?= htmlentities($recipient['name']) ?> &lt;<?= htmlentities($recipient['mail']) ?>&gt;</a></span><br/>
            <span class="il-left">Betreff: </span><span class="il-right"><?= $subject ?></span><br/>
            <span class="il-left">Anhang: </span><span class="il-right">
                <?php foreach($attachments as $attachment) { ?>
                <a href="<?= $linkurl ?>/api/?action=protectedpdf&path=<?= $attachment ?>" target="_blank"><?= basename($attachment) ?></a>&nbsp;
                <?php } ?>
            </span><br/>
        </div>
        <div class="main">
            <iframe src="<?= $mailpreviewpath ?>" border="0" frameborder="0" width="100%" height="100%"></iframe>
        </div>

    </body>
</html>
