xref: /webtrees/resources/views/admin/broadcast.phtml (revision 1270d2767576ed4a83917769b0ee3613e3b010bf)
1<?php
2
3declare(strict_types=1);
4
5use Fisharebest\Webtrees\Contracts\UserInterface;
6use Fisharebest\Webtrees\Http\RequestHandlers\BroadcastAction;
7use Fisharebest\Webtrees\Http\RequestHandlers\ControlPanel;
8use Fisharebest\Webtrees\I18N;
9use Illuminate\Support\Collection;
10
11/**
12 * @var UserInterface                 $from
13 * @var string                        $title
14 * @var string                        $to
15 * @var Collection<int,UserInterface> $recipients
16 */
17
18?>
19
20<?= view('components/breadcrumbs', ['links' => [route(ControlPanel::class) => I18N::translate('Control panel'), $title]]) ?>
21
22<h1><?= $title ?></h1>
23
24<form method="post" action="<?= e(route(BroadcastAction::class, ['to' => $to])) ?>">
25    <div class="row mb-3">
26        <label class="col-sm-3 col-form-label" for="from">
27            <?= I18N::translateContext('Email sender', 'From') ?>
28        </label>
29        <div class="col-sm-9">
30            <input class="form-control" id="from" type="text" value="<?= e($from->realName()) ?>" disabled>
31        </div>
32    </div>
33
34    <div class="row mb-3">
35        <label class="col-sm-3 col-form-label" for="to">
36            <?= I18N::translateContext('Email recipient', 'To') ?>
37        </label>
38        <div class="col-sm-9">
39            <input class="form-control" id="to" type="text" value="<?= $recipients->map(static fn (UserInterface $user): string => e($user->realName()))->implode(', ') ?>" disabled>
40        </div>
41    </div>
42
43    <div class="row mb-3">
44        <label class="col-sm-3 col-form-label" for="subject">
45            <?= I18N::translate('Subject') ?>
46        </label>
47        <div class="col-sm-9">
48            <input class="form-control" id="subject" type="text" name="subject" required="required">
49        </div>
50    </div>
51
52    <div class="row mb-3">
53        <label class="col-sm-3 col-form-label" for="body">
54            <?= I18N::translate('Message') ?>
55        </label>
56        <div class="col-sm-9">
57            <textarea class="form-control" id="body" name="body" rows="5" dir="auto" required="required"></textarea>
58        </div>
59    </div>
60
61    <div class="row mb-3">
62        <div class="col-sm-3 col-form-label"></div>
63        <div class="col-sm-9">
64            <button type="submit" class="btn btn-primary">
65                <?= I18N::translate('Send') ?>
66            </button>
67            <a class="btn btn-link" href="<?= e(route(ControlPanel::class)) ?>">
68                <?= I18N::translate('cancel') ?>
69            </a>
70        </div>
71    </div>
72
73    <?= csrf_field() ?>
74</form>
75