Add advanced mailer module

This commit is contained in:
Kijin Sung 2016-05-22 23:50:15 +09:00
parent 0961253a74
commit f9394ca26d
26 changed files with 1997 additions and 0 deletions

View file

@ -0,0 +1,13 @@
<div class="x_page-header">
<h1>{$lang->cmd_advanced_mailer}</h1>
</div>
<ul class="x_nav x_nav-tabs">
<li class="x_active"|cond="$act == 'dispAdvanced_mailerAdminConfig'"><a href="{getUrl('', 'module', 'admin', 'act', 'dispAdvanced_mailerAdminConfig')}">{$lang->cmd_advanced_mailer_general_config}</a></li>
<li class="x_active"|cond="$act == 'dispAdvanced_mailerAdminExceptions'"><a href="{getUrl('', 'module', 'admin', 'act', 'dispAdvanced_mailerAdminExceptions')}">{$lang->cmd_advanced_mailer_exception_domains}</a></li>
<li class="x_active"|cond="$act == 'dispAdvanced_mailerAdminSpfDkim'"><a href="{getUrl('', 'module', 'admin', 'act', 'dispAdvanced_mailerAdminSpfDkim')}">{$lang->cmd_advanced_mailer_spf_dkim_setting}</a></li>
<li class="x_active"|cond="$act == 'dispAdvanced_mailerAdminTestConfig'"><a href="{getUrl('', 'module', 'admin', 'act', 'dispAdvanced_mailerAdminTestConfig')}">{$lang->cmd_advanced_mailer_test}</a></li>
<li class="x_active"|cond="$act == 'dispAdvanced_mailerAdminSentMail'"><a href="{getUrl('', 'module', 'admin', 'act', 'dispAdvanced_mailerAdminSentMail')}">{$lang->cmd_advanced_mailer_log_sent_mail}</a></li>
<li class="x_active"|cond="$act == 'dispAdvanced_mailerAdminErrors'"><a href="{getUrl('', 'module', 'admin', 'act', 'dispAdvanced_mailerAdminErrors')}">{$lang->cmd_advanced_mailer_log_errors}</a></li>
</ul>

View file

@ -0,0 +1,230 @@
<include target="./common.html" />
<load target="css/config.css" />
<load target="js/config.js" />
<form class="x_form-horizontal" action="./" method="post" id="advanced_mailer">
<input type="hidden" name="module" value="advanced_mailer" />
<input type="hidden" name="act" value="procAdvanced_mailerAdminInsertConfig" />
<input type="hidden" name="success_return_url" value="{getRequestUriByServerEnviroment()}" />
<div cond="$XE_VALIDATOR_MESSAGE" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
<section class="section">
<h2 style="padding-top:12px">{$lang->cmd_advanced_mailer_sending_method_config}</h2>
<div class="advanced_mailer_description">
※ {$lang->cmd_advanced_mailer_about_sending_method}
</div>
<div class="x_control-group show-always">
<label class="x_control-label" for="advanced_mailer_sending_method">{$lang->cmd_advanced_mailer_sending_method_default}</label>
<div class="x_controls">
<select name="sending_method" id="advanced_mailer_sending_method">
<!--@foreach($sending_methods as $driver_name => $driver_definition)-->
<option value="{$driver_name}" selected="selected"|cond="$sending_method === $driver_name">{$driver_definition['name']}</option>
<!--@end-->
</select>
</div>
</div>
<script type="text/javascript">
var advanced_mailer_sending_methods = {json_encode($sending_methods)};
</script>
<div class="x_control-group hidden-by-default show-for-dummy">
<label class="x_control-label"></label>
<div class="x_controls">
<p class="x_help-block">{$lang->msg_advanced_mailer_about_dummy}<br />{$lang->msg_advanced_mailer_about_dummy_exceptions}</p>
</div>
</div>
<!--@foreach($sending_methods as $driver_name => $driver_definition)-->
<!--@foreach($driver_definition['required'] as $conf_name)-->
{@ $conf_value = escape(config("mail.$driver_name.$conf_name"))}
<!--@if($conf_name === 'smtp_host')-->
<div class="x_control-group hidden-by-default show-for-{$driver_name}">
<label class="x_control-label" for="advanced_mailer_{$driver_name}_smtp_host">{$lang->cmd_advanced_mailer_smtp_host}</label>
<div class="x_controls">
<input type="text" name="{$driver_name}_smtp_host" id="advanced_mailer_{$driver_name}_smtp_host" value="{$conf_value}" />
<select id="advanced_mailer_{$driver_name}_manual_entry">
<option value="">{$lang->cmd_advanced_mailer_smtp_manual_entry}</option>
<option value="gmail">Gmail</option>
<option value="hanmail">Hanmail</option>
<option value="naver">Naver</option>
<option value="worksmobile">Works Mobile</option>
<option value="outlook">Outlook.com</option>
<option value="yahoo">Yahoo</option>
</select>
</div>
</div>
<!--@end-->
<!--@if($conf_name === 'smtp_port')-->
<div class="x_control-group hidden-by-default show-for-{$driver_name}">
<label class="x_control-label" for="advanced_mailer_{$driver_name}_smtp_port">{$lang->cmd_advanced_mailer_smtp_port}</label>
<div class="x_controls">
<input type="text" name="{$driver_name}_smtp_port" id="advanced_mailer_{$driver_name}_smtp_port" value="{$conf_value}" />
</div>
</div>
<!--@end-->
<!--@if($conf_name === 'smtp_security')-->
<div class="x_control-group hidden-by-default show-for-{$driver_name}">
<label class="x_control-label">{$lang->cmd_advanced_mailer_smtp_security}</label>
<div class="x_controls">
<label class="x_inline" for="advanced_mailer_{$driver_name}_security_none"><input type="radio" name="{$driver_name}_smtp_security" id="advanced_mailer_{$driver_name}_security_none" value="none" checked="checked"|cond="!in_array($conf_value, array('ssl', 'tls'))" /> {$lang->cmd_advanced_mailer_smtp_security_none}</label>
<label class="x_inline" for="advanced_mailer_{$driver_name}_security_ssl"><input type="radio" name="{$driver_name}_smtp_security" id="advanced_mailer_{$driver_name}_security_ssl" value="ssl" checked="checked"|cond="$conf_value === 'ssl'" /> {$lang->cmd_advanced_mailer_smtp_security_ssl}</label>
<label class="x_inline" for="advanced_mailer_{$driver_name}_security_tls"><input type="radio" name="{$driver_name}_smtp_security" id="advanced_mailer_{$driver_name}_security_tls" value="tls" checked="checked"|cond="$conf_value === 'tls'" /> {$lang->cmd_advanced_mailer_smtp_security_tls}</label>
</div>
</div>
<!--@end-->
<!--@if($conf_name === 'smtp_user')-->
<div class="x_control-group hidden-by-default show-for-{$driver_name}">
<label class="x_control-label" for="advanced_mailer_{$driver_name}_smtp_user">{$lang->cmd_advanced_mailer_smtp_user}</label>
<div class="x_controls">
<input type="text" name="{$driver_name}_smtp_user" id="advanced_mailer_{$driver_name}_smtp_user" value="{$conf_value}" />
</div>
</div>
<!--@end-->
<!--@if($conf_name === 'smtp_pass')-->
<div class="x_control-group hidden-by-default show-for-{$driver_name}">
<label class="x_control-label" for="advanced_mailer_smtp_pass">{$lang->cmd_advanced_mailer_smtp_pass}</label>
<div class="x_controls">
<input type="smtp_pass" name="{$driver_name}_smtp_pass" id="advanced_mailer_{$driver_name}_smtp_pass" value="{$conf_value}" />
</div>
</div>
<!--@end-->
<!--@if($conf_name === 'api_type')-->
<div class="x_control-group hidden-by-default show-for-{$driver_name}">
<label class="x_control-label" for="advanced_mailer_{$driver_name}_api_type">{$lang->cmd_advanced_mailer_api_type}</label>
<div class="x_controls">
<select id="advanced_mailer_{$driver_name}_api_type" name="{$driver_name}_api_type">
<!--@foreach($driver_definition['api_types'] as $api_type)-->
<option value="{$api_type}" selected="selected"|cond="$api_type === $conf_value">{$api_type}</option>
<!--@end-->
</select>
</div>
</div>
<!--@end-->
<!--@if($conf_name === 'api_domain')-->
<div class="x_control-group hidden-by-default show-for-{$driver_name}">
<label class="x_control-label" for="advanced_mailer_{$driver_name}_api_domain">{$lang->cmd_advanced_mailer_api_domain}</label>
<div class="x_controls">
<input type="text" name="{$driver_name}_api_domain" id="advanced_mailer_{$driver_name}_api_domain" value="{$conf_value}" />
</div>
</div>
<!--@end-->
<!--@if($conf_name === 'api_token')-->
<div class="x_control-group hidden-by-default show-for-{$driver_name}">
<label class="x_control-label" for="advanced_mailer_{$driver_name}_api_token">{$lang->cmd_advanced_mailer_api_token}</label>
<div class="x_controls full-width">
<input type="text" name="{$driver_name}_api_token" id="advanced_mailer_{$driver_name}_api_token" value="{$conf_value}" />
</div>
</div>
<!--@end-->
<!--@if($conf_name === 'api_user')-->
<div class="x_control-group hidden-by-default show-for-{$driver_name}">
<label class="x_control-label" for="advanced_mailer_{$driver_name}_api_user">{$lang->cmd_advanced_mailer_api_user}</label>
<div class="x_controls">
<input type="text" name="{$driver_name}_api_user" id="advanced_mailer_{$driver_name}_api_user" value="{$conf_value}" />
</div>
</div>
<!--@end-->
<!--@if($conf_name === 'api_pass')-->
<div class="x_control-group hidden-by-default show-for-{$driver_name}">
<label class="x_control-label" for="advanced_mailer_{$driver_name}_api_pass">{$lang->cmd_advanced_mailer_api_pass}</label>
<div class="x_controls full-width">
<input type="password" name="{$driver_name}_api_pass" id="advanced_mailer_{$driver_name}_api_pass" value="{$conf_value}" />
</div>
</div>
<!--@end-->
<!--@end-->
<!--@end-->
</section>
<section class="section">
<h2 style="padding-top:12px">{$lang->cmd_advanced_mailer_sender_identity}</h2>
<div class="advanced_mailer_description">
※ {$lang->cmd_advanced_mailer_about_sender_identity}
</div>
<div class="x_control-group">
<label class="x_control-label" for="advanced_mailer_sender_name">{$lang->cmd_advanced_mailer_sender_name}</label>
<div class="x_controls">
<input type="text" name="sender_name" id="advanced_mailer_sender_name" value="{$webmaster_name}" />
</div>
</div>
<div class="x_control-group">
<label class="x_control-label" for="advanced_mailer_sender_email">{$lang->cmd_advanced_mailer_sender_email}</label>
<div class="x_controls">
<input type="text" name="sender_email" id="advanced_mailer_sender_email" value="{$webmaster_email}" />
</div>
</div>
<div class="x_control-group">
<label class="x_control-label" for="advanced_mailer_reply_to">{$lang->cmd_advanced_mailer_reply_to}</label>
<div class="x_controls">
<input type="text" name="reply_to" id="advanced_mailer_reply_to" value="{$advanced_mailer_config->reply_to}" />
</div>
</div>
<div class="x_control-group">
<label class="x_control-label">{$lang->cmd_advanced_mailer_force_sender}</label>
<div class="x_controls">
<label for="advanced_mailer_force_sender">
<input type="checkbox" name="force_sender" id="advanced_mailer_force_sender" value="Y" checked="checked"|cond="toBool($advanced_mailer_config->force_sender)" />
{$lang->cmd_advanced_mailer_about_force_sender}
</label>
<p>※ {$lang->cmd_advanced_mailer_about_force_sender_caution_line_1}<br />※ {$lang->cmd_advanced_mailer_about_force_sender_caution_line_2}</p>
</div>
</div>
</section>
<section class="section">
<h2 style="padding-top:12px">{$lang->cmd_advanced_mailer_logging}</h2>
<div class="x_control-group">
<label class="x_control-label" for="advanced_mailer_log_sent_mail">{$lang->cmd_advanced_mailer_log_sent_mail}</label>
<div class="x_controls">
<select name="log_sent_mail" id="advanced_mailer_log_sent_mail">
<option value="Y" selected="selected"|cond="toBool($advanced_mailer_config->log_sent_mail)" />{$lang->cmd_advanced_mailer_log_yes}</option>
<option value="N" selected="selected"|cond="!toBool($advanced_mailer_config->log_sent_mail)" />{$lang->cmd_advanced_mailer_log_no}</option>
</select>
</div>
</div>
<div class="x_control-group">
<label class="x_control-label">{$lang->cmd_advanced_mailer_log_errors}</label>
<div class="x_controls">
<select name="log_errors" id="advanced_mailer_log_errors">
<option value="Y" selected="selected"|cond="toBool($advanced_mailer_config->log_errors)" />{$lang->cmd_advanced_mailer_log_yes}</option>
<option value="N" selected="selected"|cond="!toBool($advanced_mailer_config->log_errors)" />{$lang->cmd_advanced_mailer_log_no}</option>
</select>
</div>
</div>
</section>
<div class="btnArea x_clearfix">
<button type="submit" class="x_btn x_btn-primary x_pull-right">{$lang->cmd_registration}</button>
</div>
</form>

View file

@ -0,0 +1,52 @@
#advanced_mailer_test_send {
padding: 3px 10px;
}
#advanced_mailer_test_result {
font-family: Consolas, monospace;
padding: 5px 0;
}
section {
margin-bottom: 10px !important;
}
input[type=password] {
font-family: "Segoe UI", Arial, sans-serif !important;
}
h2 {
padding-left: 10px;
padding-bottom: 2px;
font-size: 16px !important;
}
div.advanced_mailer_description {
margin-bottom: 10px;
margin-left: 10px;
}
div.hidden-by-default {
display: none;
}
div.full-width input {
width: 90% !important;
}
div.margin-top {
margin-top: 5px;
}
span.sender_info {
display: inline-block;
margin-top: 12px;
margin-left: 24px;
font-family: Consolas, monospace;
}
textarea.exception-domains {
width: 90% !important;
height: 80px !important;
}

View file

@ -0,0 +1,31 @@
div.advanced_mailer_description {
margin-bottom: 10px;
margin-left: 10px;
}
div.margin-top {
margin-top: 5px;
}
div.x_modal-body .monospace {
font-family: Consolas, monospace;
word-wrap: break-word;
word-break: break-word;
}
#spf_dkim_setting div.spf_dkim_item {
padding: 5px 0;
}
#spf_dkim_setting div.spf_dkim_separator {
border-top: 1px dotted #ddd;
margin: 8px 0;
}
#spf_dkim_setting span.label {
display: inline-block;
min-width: 94px;
}
#spf_dkim_setting span.monospace {
font-family: Consolas, monospace;
display: inline-block;
}

View file

@ -0,0 +1,4 @@
div.mail-log-errors {
display: none;
}

View file

@ -0,0 +1,67 @@
<include target="./common.html" />
<load target="css/config.css" />
<form class="x_form-horizontal" action="./" method="post" id="advanced_mailer">
<input type="hidden" name="module" value="advanced_mailer" />
<input type="hidden" name="act" value="procAdvanced_mailerAdminInsertExceptions" />
<input type="hidden" name="success_return_url" value="{getRequestUriByServerEnviroment()}" />
<div cond="$XE_VALIDATOR_MESSAGE" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
<section class="section">
<div class="x_control-group">
<label class="x_control-label">{$lang->cmd_advanced_mailer_sending_method_default}</label>
<div class="x_controls margin-top">
{$sending_methods[$sending_method]['name']}
<!--@if($sending_method === 'woorimail')-->
<!--@if(config('mail.woorimail.api_type') === 'free')-->
({$lang->cmd_advanced_mailer_api_type_free})
<!--@else-->
({$lang->cmd_advanced_mailer_api_type_paid})
<!--@end-->
<!--@end-->
</div>
</div>
</section>
<!--@for($i = 1; $i <= 3; $i++)-->
<section class="section">
<h2 style="padding-top:12px">{$lang->cmd_advanced_mailer_exception_group} {$i}</h2>
<div class="x_control-group">
<label class="x_control-label" for="advanced_mailer_exception_{$i}_method">{$lang->cmd_advanced_mailer_sending_method}</label>
<div class="x_controls">
<select name="exception_{$i}_method" id="advanced_mailer_exception_{$i}_method">
<option value="default">{$lang->cmd_advanced_mailer_exception_disabled}</option>
<!--@foreach($sending_methods as $driver_name => $driver_definition)-->
<option value="{$driver_name}" selected="selected"|cond="$advanced_mailer_config->exceptions[$i]['method'] === $driver_name">{$driver_definition['name']}</option>
<!--@end-->
</select>
</div>
</div>
<div class="x_control-group">
<label class="x_control-label" for="advanced_mailer_exception_{$i}_domains">{$lang->cmd_advanced_mailer_exception_domains_list}</label>
<div class="x_controls">
<textarea name="exception_{$i}_domains" id="advanced_mailer_exception_{$i}_domains" class="exception-domains">{implode(', ', $advanced_mailer_config->exceptions[$i]['domains'])}</textarea>
<p class="x_help-block">{$lang->cmd_advanced_mailer_about_exception_domains_list}</p>
</div>
</div>
</section>
<!--@end-->
<div style="margin-top:32px">
※ {$lang->cmd_advanced_mailer_about_exception_domains}
</div>
<div class="btnArea x_clearfix">
<button type="submit" class="x_btn x_btn-primary x_pull-right">{$lang->cmd_registration}</button>
</div>
</form>

View file

@ -0,0 +1,106 @@
(function($) {
$(function() {
$("#advanced_mailer_sending_method").on("change", function() {
var sending_method = $(this).val();
$("div.x_control-group.hidden-by-default").not(".show-always").each(function() {
if ($(this).hasClass("show-for-" + sending_method)) {
$(this).show();
} else {
$(this).hide();
}
});
var reply_to = $("#advanced_mailer_reply_to").parents("div.x_control-group");
if (sending_method === "woorimail") {
reply_to.hide();
} else {
reply_to.show();
}
}).triggerHandler("change");
$("#advanced_mailer_smtp_manual_entry").on("change", function() {
var auto_fill = $(this).val();
if (auto_fill === 'gmail') {
$("#advanced_mailer_smtp_host").val('smtp.gmail.com');
$("#advanced_mailer_smtp_port").val('465');
$("#advanced_mailer_smtp_security_ssl").prop("checked", true).parent().addClass("checked");
$("#advanced_mailer_smtp_security_tls").parent().removeClass("checked");
$("#advanced_mailer_smtp_security_none").parent().removeClass("checked");
$("#advanced_mailer_force_sender").prop("checked", true).parent().addClass("checked");
}
if (auto_fill === 'hanmail') {
$("#advanced_mailer_smtp_host").val('smtp.daum.net');
$("#advanced_mailer_smtp_port").val('465');
$("#advanced_mailer_smtp_security_ssl").prop("checked", true).parent().addClass("checked");
$("#advanced_mailer_smtp_security_tls").parent().removeClass("checked");
$("#advanced_mailer_smtp_security_none").parent().removeClass("checked");
$("#advanced_mailer_force_sender").prop("checked", true).parent().addClass("checked");
}
if (auto_fill === 'naver') {
$("#advanced_mailer_smtp_host").val('smtp.naver.com');
$("#advanced_mailer_smtp_port").val('587');
$("#advanced_mailer_smtp_security_tls").prop("checked", true).parent().addClass("checked");
$("#advanced_mailer_smtp_security_ssl").parent().removeClass("checked");
$("#advanced_mailer_smtp_security_none").parent().removeClass("checked");
$("#advanced_mailer_force_sender").prop("checked", true).parent().addClass("checked");
}
if (auto_fill === 'worksmobile') {
$("#advanced_mailer_smtp_host").val('smtp.worksmobile.com');
$("#advanced_mailer_smtp_port").val('587');
$("#advanced_mailer_smtp_security_tls").prop("checked", true).parent().addClass("checked");
$("#advanced_mailer_smtp_security_ssl").parent().removeClass("checked");
$("#advanced_mailer_smtp_security_none").parent().removeClass("checked");
$("#advanced_mailer_force_sender").prop("checked", true).parent().addClass("checked");
}
if (auto_fill === 'outlook') {
$("#advanced_mailer_smtp_host").val('smtp-mail.outlook.com');
$("#advanced_mailer_smtp_port").val('587');
$("#advanced_mailer_smtp_security_tls").prop("checked", true).parent().addClass("checked");
$("#advanced_mailer_smtp_security_ssl").parent().removeClass("checked");
$("#advanced_mailer_smtp_security_none").parent().removeClass("checked");
$("#advanced_mailer_force_sender").prop("checked", true).parent().addClass("checked");
}
if (auto_fill === 'yahoo') {
$("#advanced_mailer_smtp_host").val('smtp.mail.yahoo.com');
$("#advanced_mailer_smtp_port").val('465');
$("#advanced_mailer_smtp_security_ssl").prop("checked", true).parent().addClass("checked");
$("#advanced_mailer_smtp_security_tls").parent().removeClass("checked");
$("#advanced_mailer_smtp_security_none").parent().removeClass("checked");
$("#advanced_mailer_force_sender").prop("checked", true).parent().addClass("checked");
}
});
$("#advanced_mailer_woorimail_account_type_free,#advanced_mailer_woorimail_account_type_paid").on("change", function() {
if ($("#advanced_mailer_woorimail_account_type_paid").is(":checked")) {
$("#advanced_mailer_reply_to").attr("disabled", "disabled");
} else {
$("#advanced_mailer_reply_to").removeAttr("disabled");
}
}).triggerHandler("change");
$("#advanced_mailer_test_send").click(function(event) {
event.preventDefault();
$("#advanced_mailer_test_result").text("");
$(this).attr("disabled", "disabled");
var ajax_data = {
recipient_name: $("#advanced_mailer_recipient_name").val(),
recipient_email: $("#advanced_mailer_recipient_email").val(),
};
$.exec_json(
"advanced_mailer.procAdvanced_mailerAdminTestSend", ajax_data,
function(response) {
$("#advanced_mailer_test_result").html(response.test_result);
$("#advanced_mailer_test_send").removeAttr("disabled");
},
function(response) {
$("#advanced_mailer_test_result").text("AJAX Error");
$("#advanced_mailer_test_send").removeAttr("disabled");
}
);
});
});
} (jQuery));

View file

@ -0,0 +1,43 @@
(function($) {
$(function() {
$("#advanced_mailer_check_spf,#advanced_mailer_check_dkim").click(function(event) {
event.preventDefault();
var check_type = $(this).attr("id").match(/_spf$/) ? "spf" : "dkim";
var check_hostname = $(this).siblings("span.monospace").text();
if (!check_hostname) {
alert($("#spf_dkim_setting").data("nothing-to-check"));
}
$(this).attr("disabled", "disabled");
$.exec_json(
"advanced_mailer.procAdvanced_mailerAdminCheckDNSRecord",
{ hostname: check_hostname, record_type: "TXT" },
function(response) {
if (response.record_content === false) {
alert($("#spf_dkim_setting").data("check-failure"));
}
else if (response.record_content === "") {
alert('<span class="monospace">' + check_hostname + "</span> " +
$("#spf_dkim_setting").data("check-no-records"));
$(".x_modal._common._small").removeClass("_small");
}
else {
alert('<span class="monospace">' + check_hostname + "</span> " +
$("#spf_dkim_setting").data("check-result") + "<br /><br />" +
'<div class="monospace">' + response.record_content.replace("\n", "<br />") + "</div>");
$(".x_modal._common._small").removeClass("_small");
}
$("#advanced_mailer_check_" + check_type).removeAttr("disabled");
},
function(response) {
alert($("#spf_dkim_setting").data("check-failure"));
$("#advanced_mailer_check_" + check_type).removeAttr("disabled");
}
);
});
});
} (jQuery));

View file

@ -0,0 +1,15 @@
(function($) {
$(function() {
$("a.show-errors").click(function(event) {
event.preventDefault();
var error_msg = $(this).siblings("div.mail-log-errors").html();
alert(error_msg);
$(".x_modal._common._small").removeClass("_small");
});
});
} (jQuery));

View file

@ -0,0 +1,127 @@
<include target="./common.html" />
<load target="css/spf_dkim.css" />
<load target="js/spf_dkim.js" />
<div id="spf_dkim_setting" class="x_form-horizontal"
data-nothing-to-check="{$lang->cmd_advanced_mailer_nothing_to_check}"
data-check-no-records="{$lang->cmd_advanced_mailer_check_no_records}"
data-check-failure="{$lang->cmd_advanced_mailer_check_failure}"
data-check-result="{$lang->cmd_advanced_mailer_check_result}">
<div class="advanced_mailer_description">
※ {$lang->cmd_advanced_mailer_about_spf_dkim_setting}
</div>
<div class="x_control-group">
<label class="x_control-label">{$lang->cmd_advanced_mailer_sending_method_default}</label>
<div class="x_controls margin-top">
{$sending_methods[$sending_method]['name']}
<!--@if($sending_method === 'woorimail')-->
<!--@if(config('mail.woorimail.api_type') === 'free')-->
({$lang->cmd_advanced_mailer_api_type_free})
<!--@else-->
({$lang->cmd_advanced_mailer_api_type_paid})
<!--@end-->
<!--@end-->
</div>
</div>
<div class="x_control-group" cond="count($used_methods) > 1">
<label class="x_control-label">{$lang->cmd_advanced_mailer_sending_method_exceptions}</label>
<div class="x_controls">
<!--@foreach($advanced_mailer_config->exceptions as $exception)-->
<!--@if(in_array($exception['method'], $used_methods))-->
<div class="spf_dkim_item">
{$sending_methods[$exception['method']]['name']}
<!--@if($exception['method'] === 'woorimail')-->
<!--@if(config('mail.woorimail.api_type') === 'free')-->
({$lang->cmd_advanced_mailer_api_type_free})
<!--@else-->
({$lang->cmd_advanced_mailer_api_type_paid})
<!--@end-->
<!--@end-->
&mdash; {sprintf($lang->cmd_advanced_mailer_domain_count, count($exception['domains']))}
</div>
<!--@end-->
<!--@end-->
</div>
</div>
<div class="x_control-group">
<label class="x_control-label">{$lang->cmd_advanced_mailer_sender_email}</label>
<div class="x_controls margin-top">{$advanced_mailer_config->sender_email}</div>
</div>
{@ $ignore_domains = '/^(g(oogle)?mail\.com|(daum|hanmail2?)\.net|(naver|outlook|hotmail|yahoo)\.com|(hotmail|yahoo)\.co\.kr)$/i'}
<div class="x_control-group">
<label class="x_control-label">SPF</label>
<div class="x_controls">
<!--@if(preg_match($ignore_domains, $sending_domain))-->
<div class="spf_dkim_item">
{$lang->cmd_advanced_mailer_not_applicable_because_sender_domain}
</div>
<!--@elseif(!count($used_methods_with_usable_spf))-->
<div class="spf_dkim_item">
{$lang->cmd_advanced_mailer_not_applicable_because_sending_method}
</div>
<!--@else-->
<div class="spf_dkim_item">
<span class="label">{$lang->cmd_advanced_mailer_dns_hostname}</span>
<span class="monospace">{$sending_domain}</span> &nbsp;
<a href="#" id="advanced_mailer_check_spf">{$lang->cmd_advanced_mailer_check}</a>
</div>
<div class="spf_dkim_item">
<span class="label">{$lang->cmd_advanced_mailer_txt_record}</span>
<span class="monospace">v=spf1 a mx {implode(' ', $used_methods_with_usable_spf)} ~all</span>
</div>
{@ $other_infos = array()}
<!--@foreach($used_methods_with_usable_spf as $method => $spf)-->
{@ $other_info = Context::getLang('cmd_advanced_mailer_other_info_' . $method . '_spf')}
{@ if(strncmp('cmd_', $other_info, 4)) $other_infos[] = $other_info}
<!--@end-->
<div class="spf_dkim_item" cond="count($other_infos)">
<!--@foreach($other_infos as $other_info)-->
<span class="label">{$lang->cmd_advanced_mailer_other_info}</span>
<span>{$other_info}</span><br />
<!--@end-->
</div>
<!--@end-->
</div>
</div>
<div class="x_control-group">
<label class="x_control-label">DKIM</label>
<div class="x_controls">
<!--@if(preg_match($ignore_domains, $sending_domain))-->
<div class="spf_dkim_item">
{$lang->cmd_advanced_mailer_not_applicable_because_sender_domain}
</div>
<!--@elseif(!count($used_methods_with_usable_dkim))-->
<div class="spf_dkim_item">
{$lang->cmd_advanced_mailer_not_applicable_because_sending_method}
</div>
<!--@else-->
<!--@foreach($used_methods_with_usable_dkim as $method => $dkim)-->
<div class="spf_dkim_item">
<span class="label">{$lang->cmd_advanced_mailer_dns_hostname}</span>
<span class="monospace">{$dkim}.{$sending_domain}</span> &nbsp;
<a href="#" id="advanced_mailer_check_spf">{$lang->cmd_advanced_mailer_check}</a>
</div>
<div class="spf_dkim_item">
<span class="label">{$lang->cmd_advanced_mailer_txt_record}</span>
<span class="monospace">v=DKIM1; k=rsa; p=MIGfMA...{$lang->cmd_advanced_mailer_ellipsis}...QAB;</span>
</div>
{@ $other_info = Context::getLang('cmd_advanced_mailer_other_info_' . $method . '_dkim')}
{@ if(!strncmp('cmd_', $other_info, 4)) $other_info = false}
<div class="spf_dkim_item" cond="$other_info">
<span class="label">{$lang->cmd_advanced_mailer_other_info}</span>
<span>{$other_info}</span><br />
</div>
<div class="spf_dkim_separator"></div>
<!--@end-->
<!--@end-->
</div>
</div>
</div>

View file

@ -0,0 +1,45 @@
<include target="./common.html" />
<load target="css/config.css" />
<load target="js/config.js" />
<form class="x_form-horizontal" action="./" method="post" id="advanced_mailer">
<input type="hidden" name="module" value="advanced_mailer" />
<input type="hidden" name="act" value="procAdvanced_mailerAdminTestConfig" />
<input type="hidden" name="success_return_url" value="{getRequestUriByServerEnviroment()}" />
<div cond="$XE_VALIDATOR_MESSAGE" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
<section class="section">
<h2>{$lang->cmd_advanced_mailer_test}</h2>
<div class="x_control-group">
<label class="x_control-label" for="advanced_mailer_recipient_name">{$lang->cmd_advanced_mailer_recipient_name}</label>
<div class="x_controls">
<input type="text" id="advanced_mailer_recipient_name" value="{Context::get('logged_info')->nick_name}" />
</div>
</div>
<div class="x_control-group">
<label class="x_control-label" for="advanced_mailer_recipient_email">{$lang->cmd_advanced_mailer_recipient_email}</label>
<div class="x_controls">
<input type="text" id="advanced_mailer_recipient_email" value="{Context::get('logged_info')->email_address}" />
</div>
</div>
<div class="x_control-group">
<label class="x_control-label">{$lang->cmd_advanced_mailer_test_result}</label>
<div class="x_controls">
<div id="advanced_mailer_test_result"></div>
</div>
</div>
</section>
<div class="btnArea x_clearfix">
<button id="advanced_mailer_test_send" type="submit" class="x_btn x_btn-primary x_pull-right">{$lang->cmd_advanced_mailer_send}</button>
</div>
</form>

View file

@ -0,0 +1,84 @@
<include target="./common.html" />
<load target="css/view_log.css" />
<load target="js/view_log.js" />
<table id="advanced_mailer_log" class="x_table x_table-striped x_table-hover">
<caption>
<strong>Total: {number_format($total_count)}, Page: {number_format($page)}/{number_format($total_page)}</strong>
</caption>
<thead>
<tr>
<th scope="col" class="nowr">{$lang->cmd_advanced_mailer_status_sender}</th>
<th scope="col" class="nowr">{$lang->cmd_advanced_mailer_status_recipient}</th>
<th scope="col" class="nowr">{$lang->cmd_advanced_mailer_status_subject}</th>
<th scope="col" class="nowr">{$lang->cmd_advanced_mailer_status_sending_method}</th>
<th scope="col" class="nowr">{$lang->cmd_advanced_mailer_status_time}</th>
<th scope="col" class="nowr">{$lang->cmd_advanced_mailer_status}</th>
</tr>
</thead>
<tbody>
<tr loop="$advanced_mailer_log => $mail_id, $val">
<td class="nowr">
<!--@foreach($val->mail_from as $no => $mail_from)-->
<span title="{htmlspecialchars($mail_from[1])}">{htmlspecialchars($mail_from[0])}</span><br />
<!--@end-->
</td>
<td class="nowr">
<!--@foreach($val->mail_to as $no => $mail_to)-->
<span class="hidden"|cond="$no > 0" title="{htmlspecialchars($mail_to[1])}">{htmlspecialchars($mail_to[0])}</span>
<span class="show-hidden-recipients" cond="$no == 0 && count($val->mail_to) > 1">+{count($val->mail_to) - 1}</span>
<br />
<!--@end-->
</td>
<td class="nowr">{htmlspecialchars($val->subject)}</td>
<td class="nowr">
{Context::getLang('cmd_advanced_mailer_sending_method_' . $val->sending_method)}
</td>
<td class="nowr">{(zdate($val->regdate, "Y-m-d\nH:i:s"))}</td>
<td class="nowr">
<!--@if($val->status === 'success')-->
{$lang->cmd_advanced_mailer_status_success}
<!--@else-->
<a href="javascript:void(0)" class="show-errors">{$lang->cmd_advanced_mailer_status_error}</a>
<div class="mail-log-errors">
<strong>{$lang->cmd_advanced_mailer_status_error_msg}:</strong><br />
{nl2br(htmlspecialchars(trim($val->errors)))}<br /><br />
<strong>{$lang->cmd_advanced_mailer_status_calling_script}:</strong><br />
{htmlspecialchars($val->calling_script)}
</div>
<!--@end-->
</td>
</tr>
<tr cond="!$advanced_mailer_log">
<td>{$lang->msg_advanced_mailer_log_is_empty}</td>
</tr>
</tbody>
</table>
<div class="x_clearfix">
<form class="x_pagination x_pull-left" style="margin-top:8px" action="{Context::getUrl('')}" method="post" no-error-return-url="true">
<input loop="$param => $key, $val" cond="!in_array($key, array('mid', 'vid', 'act'))" type="hidden" name="{$key}" value="{$val}" />
<ul>
<li class="x_disabled"|cond="$page == 1"><a href="{getUrl('page', '')}">&laquo; {$lang->first_page}</a></li>
<!--@while($page_no = $page_navigation->getNextPage())-->
<li class="x_active"|cond="$page_no == $page"><a href="{getUrl('page', $page_no)}">{$page_no}</a></li>
<!--@end-->
<li class="x_disabled"|cond="$page == $page_navigation->last_page"><a href="{getUrl('page', $page_navigation->last_page)}">{$lang->last_page} &raquo;</a></li>
</ul>
</form>
<form class="x_pull-right x_input-append" style="margin-top:8px" action="{Context::getUrl('')}" method="post">
<input type="hidden" name="module" value="advanced_mailer" />
<input type="hidden" name="act" value="procAdvanced_mailerAdminClearSentMail" />
<input type="hidden" name="status" value="{$advanced_mailer_status}" />
<select name="clear_before_days" style="width:120px">
<option value="0">{$lang->cmd_advanced_mailer_clear_log_condition_all}</option>
<option value="1">{sprintf($lang->cmd_advanced_mailer_clear_log_condition, 1)}</option>
<option value="3">{sprintf($lang->cmd_advanced_mailer_clear_log_condition, 3)}</option>
<option value="7" selected="selected">{sprintf($lang->cmd_advanced_mailer_clear_log_condition, 7)}</option>
<option value="14">{sprintf($lang->cmd_advanced_mailer_clear_log_condition, 14)}</option>
<option value="30">{sprintf($lang->cmd_advanced_mailer_clear_log_condition, 30)}</option>
<option value="60">{sprintf($lang->cmd_advanced_mailer_clear_log_condition, 60)}</option>
</select>
<button class="x_btn" type="submit" disabled="disabled"|cond="!count($advanced_mailer_log)">{$lang->cmd_advanced_mailer_clear_log_button}</button>
</form>
</div>