xref: /webtrees/resources/views/admin/email-page.phtml (revision 81443e3cbe4eef5ccdcf8dae716a7e35f7417b60)
1<?php
2
3use Fisharebest\Webtrees\Contracts\UserInterface;
4use Fisharebest\Webtrees\Http\RequestHandlers\ControlPanel;
5use Fisharebest\Webtrees\Http\RequestHandlers\EmailPreferencesAction;
6use Fisharebest\Webtrees\Http\RequestHandlers\UserListPage;
7use Fisharebest\Webtrees\I18N;
8
9/**
10 * @var string        $body
11 * @var UserInterface $from
12 * @var string        $subject
13 * @var string        $title
14 * @var UserInterface $to
15 */
16
17?>
18
19<?= view('components/breadcrumbs', ['links' => [
20    route(ControlPanel::class) => I18N::translate('Control panel'),
21    route(UserListPage::class) => I18N::translate('User administration'),
22    $title,
23]]) ?>
24
25<h1><?= $title ?></h1>
26
27<form method="post" action="<?= e(route(EmailPreferencesAction::class, ['to' => $to->userName()])) ?>">
28    <div class="row mb-3">
29        <label class="col-sm-3 col-form-label" for="from">
30            <?= I18N::translateContext('Email sender', 'From') ?>
31        </label>
32        <div class="col-sm-9">
33            <input class="form-control" id="from" type="text" value="<?= e('"' . $from->realName() . '" <' . $from->email() . '>') ?>" dir="auto" disabled>
34        </div>
35    </div>
36
37    <div class="row mb-3">
38        <label class="col-sm-3 col-form-label" for="to">
39            <?= I18N::translateContext('Email recipient', 'To') ?>
40        </label>
41        <div class="col-sm-9">
42            <input class="form-control" id="to" type="text" value="<?= e('"' . $to->realName() . '" <' . $to->email() . '>') ?>" 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(route(UserListPage::class)) ?>">
71                <?= I18N::translate('cancel') ?>
72            </a>
73        </div>
74    </div>
75
76    <?= csrf_field() ?>
77</form>
78