xref: /webtrees/resources/views/admin/broadcast.phtml (revision 7c4ee823e27a11ed56d9f41f9255b6aee5ca1663)
1<?php
2
3use Fisharebest\Webtrees\Contracts\UserInterface;
4use Fisharebest\Webtrees\Http\RequestHandlers\BroadcastAction;
5use Fisharebest\Webtrees\Http\RequestHandlers\ControlPanel;
6use Fisharebest\Webtrees\I18N;
7use Illuminate\Support\Collection;
8
9/**
10 * @var UserInterface                 $from
11 * @var string                        $title
12 * @var string                        $to
13 * @var Collection<int,UserInterface> $recipients
14 */
15
16?>
17
18<?= view('components/breadcrumbs', ['links' => [route(ControlPanel::class) => I18N::translate('Control panel'), $title]]) ?>
19
20<h1><?= $title ?></h1>
21
22<form method="post" action="<?= e(route(BroadcastAction::class, ['to' => $to])) ?>">
23    <?= csrf_field() ?>
24
25    <div class="row form-group 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 form-group 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 form-group 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 form-group 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 form-group 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</form>
73