1dd6b2bfcSGreg Roach<?php use Fisharebest\Webtrees\I18N; ?> 2dd6b2bfcSGreg Roach<?php use Fisharebest\Webtrees\Site; ?> 3510d3f2fSGreg Roach<?php use Fisharebest\Webtrees\View; ?> 4dd6b2bfcSGreg Roach 5dd6b2bfcSGreg Roach<?= view('components/breadcrumbs', ['links' => [route('admin-control-panel') => I18N::translate('Control panel'), $title]]) ?> 6dd6b2bfcSGreg Roach 7dd6b2bfcSGreg Roach<h1><?= $title ?></h1> 8dd6b2bfcSGreg Roach 9dd6b2bfcSGreg Roach<p class="alert alert-info"> 10dd6b2bfcSGreg Roach <?= I18N::translate('To use a Google mail account, use the following settings: server=smtp.gmail.com, port=587, security=tls, username=xxxxx@gmail.com, password=[your gmail password]') . '<br>' . I18N::translate('You must also enable “less secure applications” in your Google account.') . ' <a href="https://www.google.com/settings/security/lesssecureapps">https://www.google.com/settings/security/lesssecureapps</a>' ?> 11dd6b2bfcSGreg Roach</p> 12dd6b2bfcSGreg Roach 13dd6b2bfcSGreg Roach<form method="post" class="form-horizontal"> 14dd6b2bfcSGreg Roach <?= csrf_field() ?> 15dd6b2bfcSGreg Roach 16dd6b2bfcSGreg Roach <div class="row form-group"> 17dd6b2bfcSGreg Roach <label for="SMTP_ACTIVE" class="col-sm-3 col-form-label"> 18dd6b2bfcSGreg Roach <?= /* I18N: A configuration setting */ I18N::translate('Messages') ?> 19dd6b2bfcSGreg Roach </label> 20dd6b2bfcSGreg Roach <div class="col-sm-9"> 21c9e11c2aSGreg Roach <?= view('components/select', ['name' => 'SMTP_ACTIVE', 'selected' => Site::getPreference('SMTP_ACTIVE'), 'options' => $mail_transport_options]) ?> 22dd6b2bfcSGreg Roach <p class="small text-muted"> 23dd6b2bfcSGreg Roach <?= /* I18N: Help text for the “Messages” site configuration setting */ I18N::translate('webtrees needs to send emails, such as password reminders and website notifications. To do this, it can use this server’s built in PHP mail facility (which is not always available) or an external SMTP (mail-relay) service, for which you will need to provide the connection details.') ?> 24dd6b2bfcSGreg Roach </p> 25dd6b2bfcSGreg Roach </div> 26dd6b2bfcSGreg Roach </div> 27dd6b2bfcSGreg Roach 28dd6b2bfcSGreg Roach <div class="row form-group"> 29dd6b2bfcSGreg Roach <label for="SMTP_FROM_NAME" class="col-sm-3 col-form-label"> 30dd6b2bfcSGreg Roach <?= /* I18N: A configuration setting */ I18N::translate('Sender name') ?> 31dd6b2bfcSGreg Roach </label> 32dd6b2bfcSGreg Roach <div class="col-sm-9"> 33dd6b2bfcSGreg Roach <input type="email" class="form-control" id="SMTP_FROM_NAME" name="SMTP_FROM_NAME" value="<?= e(Site::getPreference('SMTP_FROM_NAME')) ?>" placeholder="no-reply@localhost" maxlength="255"> 34dd6b2bfcSGreg Roach <p class="small text-muted"> 35dd6b2bfcSGreg Roach <?= /* I18N: Help text for the “Sender name” site configuration setting */ I18N::translate('This name is used in the “From” field, when sending automatic emails from this server.') ?> 36dd6b2bfcSGreg Roach </p> 37dd6b2bfcSGreg Roach </div> 38dd6b2bfcSGreg Roach </div> 39dd6b2bfcSGreg Roach 40dd6b2bfcSGreg Roach <h2><?= I18N::translate('SMTP mail server') ?></h2> 41dd6b2bfcSGreg Roach 42dd6b2bfcSGreg Roach <div class="row form-group"> 43dd6b2bfcSGreg Roach <label for="SMTP_HOST" class="col-sm-3 col-form-label"> 44dd6b2bfcSGreg Roach <?= /* I18N: A configuration setting */ I18N::translate('Server name') ?> 45dd6b2bfcSGreg Roach </label> 46dd6b2bfcSGreg Roach <div class="col-sm-9"> 47dd6b2bfcSGreg Roach <input type="text" class="form-control" id="SMTP_HOST" name="SMTP_HOST" value="<?= e(Site::getPreference('SMTP_HOST')) ?>" placeholder="smtp.example.com" maxlength="255" pattern="[a-z0-9-]+(\.[a-z0-9-]+)*"> 48dd6b2bfcSGreg Roach <p class="small text-muted"> 49dd6b2bfcSGreg Roach <?= /* I18N: Help text for the “Server name” site configuration setting */ I18N::translate('This is the name of the SMTP server. “localhost” means that the mail service is running on the same computer as your web server.') ?> 50dd6b2bfcSGreg Roach </p> 51dd6b2bfcSGreg Roach </div> 52dd6b2bfcSGreg Roach </div> 53dd6b2bfcSGreg Roach 54dd6b2bfcSGreg Roach <div class="row form-group"> 55dd6b2bfcSGreg Roach <label for="SMTP_PORT" class="col-sm-3 col-form-label"> 56dd6b2bfcSGreg Roach <?= /* I18N: A configuration setting */ I18N::translate('Port number') ?> 57dd6b2bfcSGreg Roach </label> 58dd6b2bfcSGreg Roach <div class="col-sm-9"> 59dd6b2bfcSGreg Roach <input type="text" class="form-control" id="SMTP_PORT" name="SMTP_PORT" value="<?= e(Site::getPreference('SMTP_PORT')) ?>" pattern="[0-9]*" placeholder="25" maxlength="5"> 60dd6b2bfcSGreg Roach <p class="small text-muted"> 61dd6b2bfcSGreg Roach <?= /* I18N: Help text for the "Port number" site configuration setting */ I18N::translate('By default, SMTP works on port 25.') ?> 62dd6b2bfcSGreg Roach </p> 63dd6b2bfcSGreg Roach </div> 64dd6b2bfcSGreg Roach </div> 65dd6b2bfcSGreg Roach 66dd6b2bfcSGreg Roach <fieldset class="form-group"> 67dd6b2bfcSGreg Roach <div class="row"> 68dd6b2bfcSGreg Roach <legend class="col-form-label col-sm-3"> 69dd6b2bfcSGreg Roach <?= /* I18N: A configuration setting */ I18N::translate('Use password') ?> 70dd6b2bfcSGreg Roach </legend> 71dd6b2bfcSGreg Roach <div class="col-sm-9"> 72b6c326d8SGreg Roach <?= view('components/radios-inline', ['name' => 'SMTP_AUTH', 'options' => [I18N::translate('no'), I18N::translate('yes')], 'selected' => (int) Site::getPreference('SMTP_AUTH')]) ?> 73dd6b2bfcSGreg Roach <p class="small text-muted"> 74dd6b2bfcSGreg Roach <?= /* I18N: Help text for the “Use password” site configuration setting */ I18N::translate('Most SMTP servers require a password.') ?> 75dd6b2bfcSGreg Roach </p> 76dd6b2bfcSGreg Roach </div> 77dd6b2bfcSGreg Roach </div> 78dd6b2bfcSGreg Roach </fieldset> 79dd6b2bfcSGreg Roach 80dd6b2bfcSGreg Roach <div class="row form-group"> 81dd6b2bfcSGreg Roach <label for="SMTP_AUTH_USER" class="col-sm-3 col-form-label"> 82dd6b2bfcSGreg Roach <?= /* I18N: A configuration setting */ I18N::translate('Username') ?> 83dd6b2bfcSGreg Roach </label> 84dd6b2bfcSGreg Roach <div class="col-sm-9"> 85dd6b2bfcSGreg Roach <input type="text" class="form-control" id="SMTP_AUTH_USER" name="SMTP_AUTH_USER" value="<?= e(Site::getPreference('SMTP_AUTH_USER')) ?>" maxlength="255"> 86dd6b2bfcSGreg Roach <p class="small text-muted"> 87dd6b2bfcSGreg Roach <?= /* I18N: Help text for the "Username" site configuration setting */ I18N::translate('The username required for authentication with the SMTP server.') ?> 88dd6b2bfcSGreg Roach </p> 89dd6b2bfcSGreg Roach </div> 90dd6b2bfcSGreg Roach </div> 91dd6b2bfcSGreg Roach 92dd6b2bfcSGreg Roach <div class="row form-group"> 93dd6b2bfcSGreg Roach <label for="SMTP_AUTH_PASS" class="col-sm-3 col-form-label"> 94dd6b2bfcSGreg Roach <?= /* I18N: A configuration setting */ I18N::translate('Password') ?> 95dd6b2bfcSGreg Roach </label> 96dd6b2bfcSGreg Roach <div class="col-sm-9"> 971f1ffa65SGreg Roach <input type="password" class="form-control" id="SMTP_AUTH_PASS" name="SMTP_AUTH_PASS" value="" autocomplete="off"> 98dd6b2bfcSGreg Roach <p class="small text-muted"> 99dd6b2bfcSGreg Roach <?= /* I18N: Help text for the "Password" site configuration setting */ I18N::translate('The password required for authentication with the SMTP server.') ?> 100dd6b2bfcSGreg Roach </p> 101dd6b2bfcSGreg Roach </div> 102dd6b2bfcSGreg Roach </div> 103dd6b2bfcSGreg Roach 104dd6b2bfcSGreg Roach <div class="row form-group"> 105dd6b2bfcSGreg Roach <label for="SMTP_SSL" class="col-sm-3 col-form-label"> 106dd6b2bfcSGreg Roach <?= /* I18N: A configuration setting */ I18N::translate('Secure connection') ?> 107dd6b2bfcSGreg Roach </label> 108dd6b2bfcSGreg Roach <div class="col-sm-9"> 109c9e11c2aSGreg Roach <?= view('components/select', ['name' => 'SMTP_SSL', 'selected' => Site::getPreference('SMTP_SSL'), 'options' => $mail_ssl_options]) ?> 110dd6b2bfcSGreg Roach <p class="small text-muted"> 111dd6b2bfcSGreg Roach <?= /* I18N: Help text for the “Secure connection” site configuration setting */ I18N::translate('Most servers do not use secure connections.') ?> 112dd6b2bfcSGreg Roach </p> 113dd6b2bfcSGreg Roach </div> 114dd6b2bfcSGreg Roach </div> 115dd6b2bfcSGreg Roach 116dd6b2bfcSGreg Roach <div class="row form-group"> 117dd6b2bfcSGreg Roach <label for="SMTP_HELO" class="col-sm-3 col-form-label"> 118dd6b2bfcSGreg Roach <?= /* I18N: A configuration setting */ I18N::translate('Sending server name') ?> 119dd6b2bfcSGreg Roach </label> 120dd6b2bfcSGreg Roach <div class="col-sm-9"> 121dd6b2bfcSGreg Roach <input type="text" class="form-control" id="SMTP_HELO" name="SMTP_HELO" value="<?= e(Site::getPreference('SMTP_HELO')) ?>" placeholder="localhost" maxlength="255" pattern="[a-z0-9-]+(\.[a-z0-9-]+)*"> 122dd6b2bfcSGreg Roach <p class="small text-muted"> 123dd6b2bfcSGreg Roach <?= /* I18N: Help text for the "Sending server name" site configuration setting */ I18N::translate('Many mail servers require that the sending server identifies itself correctly, using a valid domain name.') ?> 124dd6b2bfcSGreg Roach </p> 125dd6b2bfcSGreg Roach </div> 126dd6b2bfcSGreg Roach </div> 127dd6b2bfcSGreg Roach 128*4d99955eSGreg Roach <h2> 129*4d99955eSGreg Roach <?= /* I18N: https://en.wikipedia.org/wiki/DomainKeys_Identified_Mail */ I18N::translate('DKIM digital signature') ?> 130*4d99955eSGreg Roach </h2> 131*4d99955eSGreg Roach 132*4d99955eSGreg Roach <div class="row form-group"> 133*4d99955eSGreg Roach <label for="DKIM_DOMAIN" class="col-sm-3 col-form-label"> 134*4d99955eSGreg Roach <?= I18N::translate('Domain name') ?> 135*4d99955eSGreg Roach </label> 136*4d99955eSGreg Roach <div class="col-sm-9"> 137*4d99955eSGreg Roach <input type="text" class="form-control" id="DKIM_DOMAIN" name="DKIM_DOMAIN" value="<?= e(Site::getPreference('DKIM_DOMAIN')) ?>" maxlength="255"> 138*4d99955eSGreg Roach </div> 139*4d99955eSGreg Roach </div> 140*4d99955eSGreg Roach 141*4d99955eSGreg Roach <div class="row form-group"> 142*4d99955eSGreg Roach <label for="DKIM_SELECTOR" class="col-sm-3 col-form-label"> 143*4d99955eSGreg Roach <?= I18N::translate('Selector') ?> 144*4d99955eSGreg Roach </label> 145*4d99955eSGreg Roach <div class="col-sm-9"> 146*4d99955eSGreg Roach <input type="text" class="form-control" id="DKIM_SELECTOR" name="DKIM_SELECTOR" value="<?= e(Site::getPreference('DKIM_SELECTOR')) ?>" maxlength="255"> 147*4d99955eSGreg Roach </div> 148*4d99955eSGreg Roach </div> 149*4d99955eSGreg Roach 150*4d99955eSGreg Roach <div class="row form-group"> 151*4d99955eSGreg Roach <label for="DKIM_KEY" class="col-sm-3 col-form-label"> 152*4d99955eSGreg Roach <?= I18N::translate('Private key') ?> 153*4d99955eSGreg Roach </label> 154*4d99955eSGreg Roach <div class="col-sm-9"> 155*4d99955eSGreg Roach <textarea class="form-control" id="DKIM_KEY" name="DKIM_KEY"><?= e(Site::getPreference('DKIM_KEY')) ?></textarea> 156*4d99955eSGreg Roach </div> 157*4d99955eSGreg Roach </div> 158*4d99955eSGreg Roach 159dd6b2bfcSGreg Roach <div class="row form-group"> 160dd6b2bfcSGreg Roach <div class="offset-sm-3 col-sm-9"> 161dd6b2bfcSGreg Roach <button type="submit" class="btn btn-primary"> 162dd6b2bfcSGreg Roach <?= view('icons/save') ?> 163dd6b2bfcSGreg Roach <?= I18N::translate('save') ?> 164dd6b2bfcSGreg Roach </button> 165dd6b2bfcSGreg Roach 166dd6b2bfcSGreg Roach <a href="<?= e(route('admin-control-panel')) ?>" class="btn btn-secondary"> 167dd6b2bfcSGreg Roach <?= view('icons/cancel') ?> 168dd6b2bfcSGreg Roach <?= I18N::translate('cancel') ?> 169dd6b2bfcSGreg Roach </a> 170dd6b2bfcSGreg Roach </div> 171dd6b2bfcSGreg Roach </div> 172dd6b2bfcSGreg Roach</form> 173510d3f2fSGreg Roach 174510d3f2fSGreg Roach<?php View::push('javascript') ?> 175510d3f2fSGreg Roach<script> 176510d3f2fSGreg Roach $('#SMTP_AUTH_PASS').hideShowPassword('infer', true); 177510d3f2fSGreg Roach</script> 178510d3f2fSGreg Roach<?php View::endpush() ?> 179