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