xref: /webtrees/resources/views/admin/email-page.phtml (revision 5062b1ca554e9384a3865a8ed7fa201483b30720)
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    <?= csrf_field() ?>
29
30    <div class="form-group row">
31        <label class="col-sm-3 col-form-label" for="from">
32            <?= I18N::translateContext('Email sender', 'From') ?>
33        </label>
34        <div class="col-sm-9">
35            <input class="form-control" id="from" type="text" value="<?= e('"' . $from->realName() . '" <' . $from->email() . '>') ?>" dir="auto" disabled>
36        </div>
37    </div>
38
39    <div class="form-group row">
40        <label class="col-sm-3 col-form-label" for="to">
41            <?= I18N::translateContext('Email recipient', 'To') ?>
42        </label>
43        <div class="col-sm-9">
44            <input class="form-control" id="to" type="text" value="<?= e('"' . $to->realName() . '" <' . $to->email() . '>') ?>" dir="auto" disabled>
45        </div>
46    </div>
47
48    <div class="form-group row">
49        <label class="col-sm-3 col-form-label" for="subject">
50            <?= I18N::translate('Subject') ?>
51        </label>
52        <div class="col-sm-9">
53            <input class="form-control" id="subject" type="text" name="subject" value="<?= e($subject) ?>" required="required">
54        </div>
55    </div>
56
57    <div class="form-group row">
58        <label class="col-sm-3 col-form-label" for="body">
59            <?= I18N::translate('Message') ?>
60        </label>
61        <div class="col-sm-9">
62            <textarea class="form-control" id="body" type="text" name="body" dir="auto" rows="5" required="required"><?= e($body) ?></textarea>
63        </div>
64    </div>
65
66    <div class="form-group row">
67        <div class="col-sm-3 col-form-label"></div>
68        <div class="col-sm-9">
69            <button type="submit" class="btn btn-primary">
70                <?= I18N::translate('Send') ?>
71            </button>
72            <a class="btn btn-link" href="<?= e(route(UserListPage::class)) ?>">
73                <?= I18N::translate('cancel') ?>
74            </a>
75        </div>
76    </div>
77</form>
78