fuc/storage/framework/smarty/compile/ffd61798796edce6120dfa7046b02af17836a33a_0.file_email.tpl.php
2025-03-13 17:13:42 +08:00

545 lines
35 KiB
PHP
Executable File

<?php
/* Smarty version 5.3.1, created on 2025-02-02 20:40:53
from 'file:admin/setting/email.tpl' */
/* @var \Smarty\Template $_smarty_tpl */
if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
'version' => '5.3.1',
'unifunc' => 'content_679f67d5337be2_09308554',
'has_nocache_code' => false,
'file_dependency' =>
array (
'ffd61798796edce6120dfa7046b02af17836a33a' =>
array (
0 => 'admin/setting/email.tpl',
1 => 1712762115,
2 => 'file',
),
),
'includes' =>
array (
'file:admin/header.tpl' => 1,
'file:admin/footer.tpl' => 1,
),
))) {
function content_679f67d5337be2_09308554 (\Smarty\Template $_smarty_tpl) {
$_smarty_current_dir = '/www/wwwroot/fuuu.cloud/resources/views/tabler/admin/setting';
$_smarty_tpl->renderSubTemplate('file:admin/header.tpl', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), (int) 0, $_smarty_current_dir);
?>
<div class="page-wrapper">
<div class="container-xl">
<div class="page-header d-print-none text-white">
<div class="row align-items-center">
<div class="col">
<h2 class="page-title">
<span class="home-title">邮件设置</span>
</h2>
<div class="page-pretitle my-3">
<span class="home-subtitle">设置站点的邮件系统</span>
</div>
</div>
<div class="col-auto ms-auto d-print-none">
<div class="btn-list">
<a id="save-setting" href="#" class="btn btn-primary">
<i class="icon ti ti-device-floppy"></i>
保存
</a>
</div>
</div>
</div>
</div>
</div>
<div class="page-body">
<div class="container-xl">
<div class="row row-deck row-cards">
<div class="col-md-12">
<div class="card">
<div class="card-header">
<ul class="nav nav-tabs card-header-tabs" data-bs-toggle="tabs">
<li class="nav-item">
<a href="#email" class="nav-link active" data-bs-toggle="tab">邮件设置</a>
</li>
<li class="nav-item">
<a href="#limit" class="nav-link" data-bs-toggle="tab">发送限制</a>
</li>
<li class="nav-item">
<a href="#smtp" class="nav-link" data-bs-toggle="tab">SMTP</a>
</li>
<li class="nav-item">
<a href="#mailgun" class="nav-link" data-bs-toggle="tab">Mailgun</a>
</li>
<li class="nav-item">
<a href="#sendgrid" class="nav-link" data-bs-toggle="tab">Sendgrid</a>
</li>
<li class="nav-item">
<a href="#postal" class="nav-link" data-bs-toggle="tab">Postal</a>
</li>
<li class="nav-item">
<a href="#ses" class="nav-link" data-bs-toggle="tab">AWS SES</a>
</li>
<li class="nav-item">
<a href="#mailchimp" class="nav-link" data-bs-toggle="tab">Mailchimp</a>
</li>
<li class="nav-item">
<a href="#alibabacloud" class="nav-link" data-bs-toggle="tab">AlibabaCloud DM</a>
</li>
</ul>
</div>
<div class="card-body">
<div class="tab-content">
<div class="tab-pane active show" id="email">
<div class="card-body">
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">邮件服务提供商</label>
<div class="col">
<select id="email_driver" class="col form-select"
value="<?php echo $_smarty_tpl->getValue('settings')['email_driver'];?>
">
<option value="none"
<?php if ($_smarty_tpl->getValue('settings')['email_driver'] === "none") {?>selected<?php }?>>none
</option>
<option value="smtp"
<?php if ($_smarty_tpl->getValue('settings')['email_driver'] === "smtp") {?>selected<?php }?>>smtp
</option>
<option value="mailgun"
<?php if ($_smarty_tpl->getValue('settings')['email_driver'] === "mailgun") {?>selected<?php }?>>
mailgun
</option>
<option value="sendgrid"
<?php if ($_smarty_tpl->getValue('settings')['email_driver'] === "sendgrid") {?>selected<?php }?>>
sendgrid
</option>
<option value="postal"
<?php if ($_smarty_tpl->getValue('settings')['email_driver'] === "postal") {?>selected<?php }?>>
postal
</option>
<option value="ses"
<?php if ($_smarty_tpl->getValue('settings')['email_driver'] === "ses") {?>selected<?php }?>>
ses
</option>
<option value="mailchimp"
<?php if ($_smarty_tpl->getValue('settings')['email_driver'] === "mailchimp") {?>selected<?php }?>>
mailchimp
</option>
<option value="alibabacloud"
<?php if ($_smarty_tpl->getValue('settings')['email_driver'] === "alibabacloud") {?>selected<?php }?>>
alibabacloud
</option>
</select>
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">测试邮件接收地址</label>
<input type="text" class="form-control" id="recipient" value="">
<div class="row my-3">
<div class="col">
<button id="test-email" class="btn btn-primary">发送测试邮件
</button>
</div>
</div>
</div>
</div>
</div>
<div class="tab-pane" id="limit">
<div class="card-body">
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">邮箱验证码有效期(秒)</label>
<div class="col">
<input id="email_verify_code_ttl" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('settings')['email_verify_code_ttl'];?>
">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">邮箱重设密码链接有效期(秒)</label>
<div class="col">
<input id="email_password_reset_ttl" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('settings')['email_password_reset_ttl'];?>
">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">单个IP每小时可请求的发信次数</label>
<div class="col">
<input id="email_request_ip_limit" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('settings')['email_request_ip_limit'];?>
">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">单个邮箱地址每小时可请求的发信次数</label>
<div class="col">
<input id="email_request_address_limit" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('settings')['email_request_address_limit'];?>
">
</div>
</div>
</div>
</div>
<div class="tab-pane" id="smtp">
<div class="card-body">
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">Host</label>
<div class="col">
<input id="smtp_host" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('settings')['smtp_host'];?>
">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">Username</label>
<div class="col">
<input id="smtp_username" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('settings')['smtp_username'];?>
">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">Password</label>
<div class="col">
<input id="smtp_password" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('settings')['smtp_password'];?>
">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">Port</label>
<div class="col">
<select id="smtp_port" class="col form-select"
value="<?php echo $_smarty_tpl->getValue('settings')['smtp_port'];?>
">
<option value="465"
<?php if ($_smarty_tpl->getValue('settings')['smtp_port'] === "465") {?>selected<?php }?>>465
</option>
<option value="587"
<?php if ($_smarty_tpl->getValue('settings')['smtp_port'] === "587") {?>selected<?php }?>>587
</option>
<option value="443"
<?php if ($_smarty_tpl->getValue('settings')['smtp_port'] === "443") {?>selected<?php }?>>443
</option>
<option value="80"
<?php if ($_smarty_tpl->getValue('settings')['smtp_port'] === "80") {?>selected<?php }?>>80
</option>
<option value="2525"
<?php if ($_smarty_tpl->getValue('settings')['smtp_port'] === "2525") {?>selected<?php }?>>2525
</option>
<option value="25"
<?php if ($_smarty_tpl->getValue('settings')['smtp_port'] === "25") {?>selected<?php }?>>25
</option>
</select>
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">Name</label>
<div class="col">
<input id="smtp_name" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('settings')['smtp_name'];?>
">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">Sener</label>
<div class="col">
<input id="smtp_sender" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('settings')['smtp_sender'];?>
">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">Enable TLS/SSL</label>
<div class="col">
<select id="smtp_ssl" class="col form-select"
value="<?php echo $_smarty_tpl->getValue('settings')['smtp_ssl'];?>
">
<option value="0" <?php if (!$_smarty_tpl->getValue('settings')['smtp_ssl']) {?>selected<?php }?>>False
</option>
<option value="1" <?php if ($_smarty_tpl->getValue('settings')['smtp_ssl']) {?>selected<?php }?>>True
</option>
</select>
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">BBC</label>
<div class="col">
<input id="smtp_bbc" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('settings')['smtp_bbc'];?>
">
</div>
</div>
</div>
</div>
<div class="tab-pane" id="mailgun">
<div class="card-body">
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">Api Key</label>
<div class="col">
<input id="mailgun_key" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('settings')['mailgun_key'];?>
">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">Domain</label>
<div class="col">
<input id="mailgun_domain" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('settings')['mailgun_domain'];?>
">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">Sender</label>
<div class="col">
<input id="mailgun_sender" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('settings')['mailgun_sender'];?>
">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">Sender Name</label>
<div class="col">
<input id="mailgun_sender_name" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('settings')['mailgun_sender_name'];?>
">
</div>
</div>
</div>
</div>
<div class="tab-pane" id="sendgrid">
<div class="card-body">
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">Api Key</label>
<div class="col">
<input id="sendgrid_key" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('settings')['sendgrid_key'];?>
">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">Sender</label>
<div class="col">
<input id="sendgrid_sender" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('settings')['sendgrid_sender'];?>
">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">Name</label>
<div class="col">
<input id="sendgrid_name" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('settings')['sendgrid_name'];?>
">
</div>
</div>
</div>
</div>
<div class="tab-pane" id="postal">
<div class="card-body">
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">Host</label>
<div class="col">
<input id="postal_host" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('settings')['postal_host'];?>
">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">Api Key</label>
<div class="col">
<input id="postal_key" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('settings')['postal_key'];?>
">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">Sender</label>
<div class="col">
<input id="postal_sender" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('settings')['postal_sender'];?>
">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">Name</label>
<div class="col">
<input id="postal_name" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('settings')['postal_name'];?>
">
</div>
</div>
</div>
</div>
<div class="tab-pane" id="ses">
<div class="card-body">
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">Access Key ID</label>
<div class="col">
<input id="aws_ses_access_key_id" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('settings')['aws_ses_access_key_id'];?>
">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">Access Key Secret</label>
<div class="col">
<input id="aws_ses_access_key_secret" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('settings')['aws_ses_access_key_secret'];?>
">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">Region</label>
<div class="col">
<input id="aws_ses_region" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('settings')['aws_ses_region'];?>
">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">Sender</label>
<div class="col">
<input id="aws_ses_sender" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('settings')['aws_ses_sender'];?>
">
</div>
</div>
</div>
</div>
<div class="tab-pane" id="mailchimp">
<div class="card-body">
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">Api Key</label>
<div class="col">
<input id="mailchimp_key" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('settings')['mailchimp_key'];?>
">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">From Email</label>
<div class="col">
<input id="mailchimp_from_email" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('settings')['mailchimp_from_email'];?>
">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">From Name</label>
<div class="col">
<input id="mailchimp_from_name" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('settings')['mailchimp_from_name'];?>
">
</div>
</div>
</div>
</div>
<div class="tab-pane" id="alibabacloud">
<div class="card-body">
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">Access Key ID</label>
<div class="col">
<input id="alibabacloud_dm_access_key_id" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('settings')['alibabacloud_dm_access_key_id'];?>
">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">Access Key Secret</label>
<div class="col">
<input id="alibabacloud_dm_access_key_secret" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('settings')['alibabacloud_dm_access_key_secret'];?>
">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">Endpoint</label>
<div class="col">
<input id="alibabacloud_dm_endpoint" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('settings')['alibabacloud_dm_endpoint'];?>
">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">Account Name</label>
<div class="col">
<input id="alibabacloud_dm_account_name" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('settings')['alibabacloud_dm_account_name'];?>
">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">From Alias</label>
<div class="col">
<input id="alibabacloud_dm_from_alias" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('settings')['alibabacloud_dm_from_alias'];?>
">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php echo '<script'; ?>
>
$("#save-setting").click(function () {
$.ajax({
url: '/admin/setting/email',
type: 'POST',
dataType: "json",
data: {
<?php
$_from = $_smarty_tpl->getSmarty()->getRuntime('Foreach')->init($_smarty_tpl, $_smarty_tpl->getValue('update_field'), 'key');
$foreach0DoElse = true;
foreach ($_from ?? [] as $_smarty_tpl->getVariable('key')->value) {
$foreach0DoElse = false;
?>
<?php echo $_smarty_tpl->getValue('key');?>
: $('#<?php echo $_smarty_tpl->getValue('key');?>
').val(),
<?php
}
$_smarty_tpl->getSmarty()->getRuntime('Foreach')->restore($_smarty_tpl, 1);?>
},
success: function (data) {
if (data.ret === 1) {
$('#success-message').text(data.msg);
$('#success-dialog').modal('show');
} else {
$('#fail-message').text(data.msg);
$('#fail-dialog').modal('show');
}
}
})
});
$("#test-email").click(function () {
$.ajax({
url: '/admin/setting/test/email',
type: 'POST',
dataType: "json",
data: {
recipient: $('#recipient').val(),
},
success: function (data) {
if (data.ret === 1) {
$('#success-noreload-message').text(data.msg);
$('#success-noreload-dialog').modal('show');
} else {
$('#fail-message').text(data.msg);
$('#fail-dialog').modal('show');
}
}
})
});
<?php echo '</script'; ?>
>
<?php $_smarty_tpl->renderSubTemplate('file:admin/footer.tpl', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), (int) 0, $_smarty_current_dir);
}
}