xref: /webtrees/resources/views/admin/broadcast.phtml (revision 81443e3cbe4eef5ccdcf8dae716a7e35f7417b60)
10c0910bfSGreg Roach<?php
2dd6b2bfcSGreg Roach
37c2c99faSGreg Roachuse Fisharebest\Webtrees\Contracts\UserInterface;
4e381f98dSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\BroadcastAction;
50c0910bfSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\ControlPanel;
60c0910bfSGreg Roachuse Fisharebest\Webtrees\I18N;
77c2c99faSGreg Roachuse Illuminate\Support\Collection;
87c2c99faSGreg Roach
97c2c99faSGreg Roach/**
107c2c99faSGreg Roach * @var UserInterface                 $from
117c2c99faSGreg Roach * @var string                        $title
127c2c99faSGreg Roach * @var string                        $to
13a46dd5a6SGreg Roach * @var Collection<int,UserInterface> $recipients
147c2c99faSGreg Roach */
150c0910bfSGreg Roach
160c0910bfSGreg Roach?>
170c0910bfSGreg Roach
180c0910bfSGreg Roach<?= view('components/breadcrumbs', ['links' => [route(ControlPanel::class) => I18N::translate('Control panel'), $title]]) ?>
19dd6b2bfcSGreg Roach
20dd6b2bfcSGreg Roach<h1><?= $title ?></h1>
21dd6b2bfcSGreg Roach
22a46dd5a6SGreg Roach<form method="post" action="<?= e(route(BroadcastAction::class, ['to' => $to])) ?>">
239e3c2cf9SGreg Roach    <div class="row mb-3">
24dd6b2bfcSGreg Roach        <label class="col-sm-3 col-form-label" for="from">
25f80607a6SGreg Roach            <?= I18N::translateContext('Email sender', 'From') ?>
26dd6b2bfcSGreg Roach        </label>
27dd6b2bfcSGreg Roach        <div class="col-sm-9">
28e5a6b4d4SGreg Roach            <input class="form-control" id="from" type="text" value="<?= e($from->realName()) ?>" disabled>
29dd6b2bfcSGreg Roach        </div>
30dd6b2bfcSGreg Roach    </div>
31dd6b2bfcSGreg Roach
329e3c2cf9SGreg Roach    <div class="row mb-3">
33dd6b2bfcSGreg Roach        <label class="col-sm-3 col-form-label" for="to">
34f80607a6SGreg Roach            <?= I18N::translateContext('Email recipient', 'To') ?>
35dd6b2bfcSGreg Roach        </label>
36dd6b2bfcSGreg Roach        <div class="col-sm-9">
37a46dd5a6SGreg Roach            <input class="form-control" id="to" type="text" value="<?= $recipients->map(static fn (UserInterface $user): string => e($user->realName()))->implode(', ') ?>" disabled>
38dd6b2bfcSGreg Roach        </div>
39dd6b2bfcSGreg Roach    </div>
40dd6b2bfcSGreg Roach
419e3c2cf9SGreg Roach    <div class="row mb-3">
42dd6b2bfcSGreg Roach        <label class="col-sm-3 col-form-label" for="subject">
43dd6b2bfcSGreg Roach            <?= I18N::translate('Subject') ?>
44dd6b2bfcSGreg Roach        </label>
45dd6b2bfcSGreg Roach        <div class="col-sm-9">
46a46dd5a6SGreg Roach            <input class="form-control" id="subject" type="text" name="subject" required="required">
47dd6b2bfcSGreg Roach        </div>
48dd6b2bfcSGreg Roach    </div>
49dd6b2bfcSGreg Roach
509e3c2cf9SGreg Roach    <div class="row mb-3">
51dd6b2bfcSGreg Roach        <label class="col-sm-3 col-form-label" for="body">
52dd6b2bfcSGreg Roach            <?= I18N::translate('Message') ?>
53dd6b2bfcSGreg Roach        </label>
54dd6b2bfcSGreg Roach        <div class="col-sm-9">
55a46dd5a6SGreg Roach            <textarea class="form-control" id="body" name="body" rows="5" dir="auto" required="required"></textarea>
56dd6b2bfcSGreg Roach        </div>
57dd6b2bfcSGreg Roach    </div>
58dd6b2bfcSGreg Roach
599e3c2cf9SGreg Roach    <div class="row mb-3">
60dd6b2bfcSGreg Roach        <div class="col-sm-3 col-form-label"></div>
61dd6b2bfcSGreg Roach        <div class="col-sm-9">
62dd6b2bfcSGreg Roach            <button type="submit" class="btn btn-primary">
63dd6b2bfcSGreg Roach                <?= I18N::translate('Send') ?>
64dd6b2bfcSGreg Roach            </button>
65a46dd5a6SGreg Roach            <a class="btn btn-link" href="<?= e(route(ControlPanel::class)) ?>">
66dd6b2bfcSGreg Roach                <?= I18N::translate('cancel') ?>
67dd6b2bfcSGreg Roach            </a>
68dd6b2bfcSGreg Roach        </div>
69dd6b2bfcSGreg Roach    </div>
70*81443e3cSGreg Roach
71*81443e3cSGreg Roach    <?= csrf_field() ?>
72dd6b2bfcSGreg Roach</form>
73