1<?php 2 3declare(strict_types=1); 4 5use Fisharebest\Webtrees\Contracts\UserInterface; 6use Fisharebest\Webtrees\Http\RequestHandlers\MessageAction; 7use Fisharebest\Webtrees\I18N; 8use Fisharebest\Webtrees\Tree; 9 10/** 11 * @var string $body 12 * @var UserInterface $from 13 * @var string $subject 14 * @var UserInterface $to 15 * @var Tree $tree 16 * @var string $title 17 * @var string $url 18 */ 19 20?> 21 22<h2><?= $title ?></h2> 23 24<form method="post" action="<?= e(route(MessageAction::class, ['tree' => $tree->name()])) ?>"> 25 <input type="hidden" name="url" value="<?= e($url) ?>"> 26 27 <div class="row mb-3"> 28 <label class="col-sm-3 col-form-label" for="from"> 29 <?= I18N::translateContext('Email sender', 'From') ?> 30 </label> 31 <div class="col-sm-9"> 32 <input class="form-control" id="from" type="text" value="<?= e($from->realName()) ?>" dir="auto" disabled> 33 </div> 34 </div> 35 36 <div class="row mb-3"> 37 <label class="col-sm-3 col-form-label" for="to"> 38 <?= I18N::translateContext('Email recipient', 'To') ?> 39 </label> 40 <div class="col-sm-9"> 41 <input type="hidden" name="to" value="<?= e($to->userName()) ?>"> 42 <input class="form-control" id="to" type="text" value="<?= e($to->realName()) ?>" dir="auto" disabled> 43 </div> 44 </div> 45 46 <div class="row mb-3"> 47 <label class="col-sm-3 col-form-label" for="subject"> 48 <?= I18N::translate('Subject') ?> 49 </label> 50 <div class="col-sm-9"> 51 <input class="form-control" id="subject" type="text" name="subject" value="<?= e($subject) ?>" required="required"> 52 </div> 53 </div> 54 55 <div class="row mb-3"> 56 <label class="col-sm-3 col-form-label" for="body"> 57 <?= I18N::translate('Message') ?> 58 </label> 59 <div class="col-sm-9"> 60 <textarea class="form-control" id="body" type="text" name="body" dir="auto" rows="5" required="required"><?= e($body) ?></textarea> 61 </div> 62 </div> 63 64 <div class="row mb-3"> 65 <div class="col-sm-3 col-form-label"></div> 66 <div class="col-sm-9"> 67 <button type="submit" class="btn btn-primary"> 68 <?= I18N::translate('Send') ?> 69 </button> 70 <a class="btn btn-link" href="<?= e($url) ?>"> 71 <?= I18N::translate('cancel') ?> 72 </a> 73 </div> 74 </div> 75 76 <?= csrf_field() ?> 77</form> 78