2020-10-05 08:42:19 +02:00
|
|
|
@model BTCPayServer.Models.ServerViewModels.EmailsViewModel
|
2019-05-01 05:17:25 +02:00
|
|
|
|
|
|
|
<div class="row">
|
2021-04-08 15:32:42 +02:00
|
|
|
<div class="col-lg-6">
|
|
|
|
<div class="d-flex align-items-center justify-content-between mb-4">
|
|
|
|
<h2 class="mb-0">@ViewData["Title"]</h2>
|
2021-05-19 04:39:27 +02:00
|
|
|
<div class="dropdown only-for-js" id="quick-fill">
|
|
|
|
<button class="btn btn-primary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false" id="QuickFillDropdownToggle">
|
2021-08-28 06:14:04 +02:00
|
|
|
Quick Fill
|
2021-04-08 15:32:42 +02:00
|
|
|
</button>
|
2021-05-19 04:39:27 +02:00
|
|
|
<div class="dropdown-menu" aria-labelledby="QuickFillDropdownToggle">
|
|
|
|
<a class="dropdown-item" href="" data-server="smtp.gmail.com" data-port="587" data-enablessl="true">Gmail.com</a>
|
|
|
|
<a class="dropdown-item" href="" data-server="mail.yahoo.com" data-port="587" data-enablessl="true">Yahoo.com</a>
|
|
|
|
<a class="dropdown-item" href="" data-server="smtp.mailgun.org" data-port="587" data-enablessl="true">Mailgun</a>
|
|
|
|
<a class="dropdown-item" href="" data-server="smtp.office365.com" data-port="587" data-enablessl="true">Office365</a>
|
|
|
|
<a class="dropdown-item" href="" data-server="smtp.sendgrid.net" data-port="587" data-enablessl="true">SendGrid</a>
|
2021-04-08 15:32:42 +02:00
|
|
|
</div>
|
2019-08-07 21:31:08 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2020-07-09 17:22:22 +02:00
|
|
|
<form method="post" autocomplete="off">
|
|
|
|
<div class="row">
|
2021-04-08 15:32:42 +02:00
|
|
|
<div class="col-lg-6">
|
|
|
|
@if (!ViewContext.ModelState.IsValid)
|
|
|
|
{
|
|
|
|
<div asp-validation-summary="All" class="text-danger"></div>
|
|
|
|
}
|
2019-05-01 05:17:25 +02:00
|
|
|
<div class="form-group">
|
2021-05-19 04:39:27 +02:00
|
|
|
<label asp-for="Settings.Server" class="form-label"></label>
|
|
|
|
<input asp-for="Settings.Server" data-fill="server" class="form-control"/>
|
2019-05-01 05:17:25 +02:00
|
|
|
<span asp-validation-for="Settings.Server" class="text-danger"></span>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2021-05-19 04:39:27 +02:00
|
|
|
<label asp-for="Settings.Port" class="form-label"></label>
|
|
|
|
<input asp-for="Settings.Port" data-fill="port" class="form-control"/>
|
2019-05-01 05:17:25 +02:00
|
|
|
<span asp-validation-for="Settings.Port" class="text-danger"></span>
|
|
|
|
</div>
|
2019-07-14 15:45:14 +02:00
|
|
|
<div class="form-group">
|
2021-05-19 04:39:27 +02:00
|
|
|
<label asp-for="Settings.FromDisplay" class="form-label"></label>
|
2021-04-08 15:32:42 +02:00
|
|
|
<input asp-for="Settings.FromDisplay" class="form-control"/>
|
2019-08-07 21:31:08 +02:00
|
|
|
<small class="form-text text-muted">
|
|
|
|
Some email providers (like Gmail) don't allow you to set your display name, so this setting may not have any effect.
|
|
|
|
</small>
|
2019-07-14 15:45:14 +02:00
|
|
|
<span asp-validation-for="Settings.FromDisplay" class="text-danger"></span>
|
|
|
|
</div>
|
2019-05-01 05:17:25 +02:00
|
|
|
<div class="form-group">
|
2021-05-19 04:39:27 +02:00
|
|
|
<label asp-for="Settings.From" class="form-label"></label>
|
2021-04-08 15:32:42 +02:00
|
|
|
<input asp-for="Settings.From" class="form-control"/>
|
2019-05-01 05:17:25 +02:00
|
|
|
<span asp-validation-for="Settings.From" class="text-danger"></span>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2021-05-19 04:39:27 +02:00
|
|
|
<label asp-for="Settings.Login" class="form-label"></label>
|
2021-04-08 15:32:42 +02:00
|
|
|
<input asp-for="Settings.Login" class="form-control"/>
|
2019-08-07 21:31:08 +02:00
|
|
|
<small class="form-text text-muted">
|
2020-10-05 08:42:19 +02:00
|
|
|
For many email providers (like Gmail) your login is your email address.
|
2019-08-07 21:31:08 +02:00
|
|
|
</small>
|
2019-05-01 05:17:25 +02:00
|
|
|
<span asp-validation-for="Settings.Login" class="text-danger"></span>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2020-10-05 08:42:19 +02:00
|
|
|
@if (!Model.PasswordSet)
|
|
|
|
{
|
|
|
|
|
2021-05-19 04:39:27 +02:00
|
|
|
<label asp-for="Settings.Password" class="form-label"></label>
|
2021-04-08 15:32:42 +02:00
|
|
|
<input asp-for="Settings.Password" type="password" class="form-control"/>
|
2020-10-05 08:42:19 +02:00
|
|
|
<span asp-validation-for="Settings.Password" class="text-danger"></span>
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-05-19 04:39:27 +02:00
|
|
|
<label asp-for="Settings.Password" class="form-label"></label>
|
2020-10-05 08:42:19 +02:00
|
|
|
<div class="input-group">
|
2021-04-08 15:32:42 +02:00
|
|
|
<input value="Configured" type="text" readonly class="form-control"/>
|
2021-05-19 04:39:27 +02:00
|
|
|
<button type="submit" class="btn btn-danger" name="command" value="ResetPassword">Reset</button>
|
2020-10-05 08:42:19 +02:00
|
|
|
</div>
|
|
|
|
}
|
2019-05-01 05:17:25 +02:00
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2021-06-06 13:44:54 +02:00
|
|
|
<label asp-for="Settings.EnableSSL" class="form-label"></label>
|
|
|
|
<input asp-for="Settings.EnableSSL" type="checkbox" data-fill="enablessl" class="btcpay-toggle ms-2" />
|
2019-05-01 05:17:25 +02:00
|
|
|
</div>
|
2021-04-08 15:32:42 +02:00
|
|
|
<input asp-for="PasswordSet" type="hidden"/>
|
2020-07-09 17:22:22 +02:00
|
|
|
<button type="submit" class="btn btn-primary" name="command" value="Save">Save</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<hr class="mt-5 mb-4" />
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-6">
|
2019-05-01 05:17:25 +02:00
|
|
|
<div class="form-group">
|
2020-07-09 17:22:22 +02:00
|
|
|
<p class="form-text text-muted">
|
|
|
|
If you want to test your settings, enter an email address here and click "Send Test Email".
|
|
|
|
<strong>Your settings won't be saved</strong>, only a test email will be sent.
|
2020-10-05 08:42:19 +02:00
|
|
|
<br />
|
2020-07-09 17:22:22 +02:00
|
|
|
After a successful test, you can click "Save".
|
|
|
|
</p>
|
2021-05-19 04:39:27 +02:00
|
|
|
<label asp-for="TestEmail" class="form-label"></label>
|
2020-10-05 08:42:19 +02:00
|
|
|
<input asp-for="TestEmail" class="form-control" />
|
2019-05-01 05:17:25 +02:00
|
|
|
<span asp-validation-for="TestEmail" class="text-danger"></span>
|
|
|
|
</div>
|
2020-07-09 17:22:22 +02:00
|
|
|
<button type="submit" class="btn btn-secondary" name="command" value="Test">Send Test Email</button>
|
|
|
|
</div>
|
2019-05-01 05:17:25 +02:00
|
|
|
</div>
|
2020-07-09 17:22:22 +02:00
|
|
|
</form>
|
2019-05-01 05:17:25 +02:00
|
|
|
|
2021-04-08 15:32:42 +02:00
|
|
|
<script>
|
2021-05-19 04:39:27 +02:00
|
|
|
document.addEventListener("DOMContentLoaded", function () {
|
|
|
|
delegate('click', '#quick-fill .dropdown-menu a', function (e) {
|
2021-04-08 15:32:42 +02:00
|
|
|
e.preventDefault();
|
2021-05-19 04:39:27 +02:00
|
|
|
|
|
|
|
const data = e.target.dataset;
|
|
|
|
Object.keys(data).forEach(function (key) {
|
|
|
|
const value = data[key];
|
|
|
|
const input = document.querySelector('input[data-fill="' + key + '"]');
|
|
|
|
if (input) {
|
|
|
|
const type = input.getAttribute('type');
|
|
|
|
if (type === 'checkbox') {
|
|
|
|
input.checked = value;
|
|
|
|
} else {
|
|
|
|
input.value = value;
|
|
|
|
}
|
2021-04-08 15:32:42 +02:00
|
|
|
}
|
2021-05-19 04:39:27 +02:00
|
|
|
});
|
2021-04-08 15:32:42 +02:00
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|