<?php

declare(strict_types=1);

use Fisharebest\Webtrees\Contracts\UserInterface;
use Fisharebest\Webtrees\I18N;

/**
 * @var string        $message
 * @var UserInterface $recipient
 * @var UserInterface $sender
 * @var string        $url
 */

?>
<div dir="<?= I18N::locale()->direction() ?>" lang="<?= I18N::locale()->languageTag() ?>">
    <p>
        <?= I18N::translate('Hello %s…', '<bdi>' . e($recipient->realName()) . '</bdi>') ?>
    </p>

    <p>
        <?= /* I18N: %s is a person's name */
        I18N::translate('%s sent you the following message.', I18N::translate('%1$s (%2$s)', e($sender->realName()), e($sender->email()))) ?>
    </p>

    <hr>

    <p>
        <?= nl2br(e($message), false) ?>
    </p>

    <hr>

    <?php if ($url !== '') : ?>
        <p>
            <?= I18N::translate('This message was sent while viewing the following URL: ') ?>
            <?= e($url) ?>
        </p>
    <?php endif ?>
</div>
