Update advanced mailer module to accommodate both email and SMS

This commit is contained in:
Kijin Sung 2016-12-13 23:57:04 +09:00
parent 6a9185d2b3
commit 211a201e04
10 changed files with 68 additions and 34 deletions

View file

@ -20,6 +20,8 @@ class Advanced_MailerAdminController extends Advanced_Mailer
$config = $this->getConfig();
$config->log_sent_mail = toBool($vars->log_sent_mail);
$config->log_errors = toBool($vars->log_errors);
$config->log_sent_sms = toBool($vars->log_sent_sms);
$config->log_sms_errors = toBool($vars->log_sms_errors);
$output = getController('module')->insertModuleConfig('advanced_mailer', $config);
if ($output->toBool())
{
@ -180,7 +182,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
/**
* Send a test email using a temporary configuration.
*/
public function procAdvanced_MailerAdminTestSend()
public function procAdvanced_MailerAdminTestSendMail()
{
$advanced_mailer_config = $this->getConfig();
$recipient_config = Context::gets('recipient_name', 'recipient_email');

View file

@ -112,7 +112,7 @@ class Advanced_MailerAdminView extends Advanced_Mailer
/**
* Display the test send form.
*/
public function dispAdvanced_MailerAdminTestConfig()
public function dispAdvanced_MailerAdminMailTest()
{
$advanced_mailer_config = $this->getConfig();
$sending_methods = Rhymix\Framework\Mail::getSupportedDrivers();
@ -128,7 +128,7 @@ class Advanced_MailerAdminView extends Advanced_Mailer
/**
* Display the sent mail log.
*/
public function dispAdvanced_MailerAdminSentMail()
public function dispAdvanced_MailerAdminMailLog()
{
$obj = new stdClass();
$obj->status = 'success';
@ -154,7 +154,7 @@ class Advanced_MailerAdminView extends Advanced_Mailer
/**
* Display the error log.
*/
public function dispAdvanced_MailerAdminErrors()
public function dispAdvanced_MailerAdminMailErrors()
{
$obj = new stdClass();
$obj->status = 'error';

View file

@ -1,17 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<module version="0.2">
<title xml:lang="ko">고급 메일 발송 모듈</title>
<title xml:lang="en">Advanced Mailer</title>
<title xml:lang="ko">고급 메일 발송 모듈 (메일 및 SMS 관리)</title>
<title xml:lang="en">Advanced Mailer (with SMS)</title>
<description xml:lang="ko">
외부 SMTP 서버 또는 API를 사용하여 메일을 발송합니다.
라이믹스에서 발송하는 메일과 SMS를 기록하고 테스트하는 기능을 제공합니다.
</description>
<description xml:lang="en">
Send mail using an external SMTP server or API service.
Log and test e-mails and SMS sent from Rhymix.
</description>
<version>2.0.0</version>
<date>2016-05-22</date>
<author email_address="kijin@kijinsung.com" link="https://github.com/kijin">
<name xml:lang="ko">Kijin Sung</name>
<name xml:lang="en">Kijin Sung</name>
<version>2.1.0</version>
<date>2016-12-14</date>
<author link="https://www.poesis.org">
<name xml:lang="ko">포에시스</name>
<name xml:lang="en">POESIS</name>
</author>
</module>

View file

@ -6,14 +6,17 @@
<action name="dispAdvanced_mailerAdminConfig" type="view" admin_index="true" menu_name="advanced_mailer" />
<action name="dispAdvanced_mailerAdminExceptions" type="view" />
<action name="dispAdvanced_mailerAdminSpfDkim" type="view" />
<action name="dispAdvanced_mailerAdminTestConfig" type="view" />
<action name="dispAdvanced_mailerAdminSentMail" type="view" />
<action name="dispAdvanced_mailerAdminErrors" type="view" />
<action name="dispAdvanced_mailerAdminMailTest" type="view" />
<action name="dispAdvanced_mailerAdminMailLog" type="view" />
<action name="dispAdvanced_mailerAdminMailErrors" type="view" />
<action name="dispAdvanced_mailerAdminSMSTest" type="view" />
<action name="dispAdvanced_mailerAdminSMSLog" type="view" />
<action name="dispAdvanced_mailerAdminSMSErrors" type="view" />
<action name="procAdvanced_mailerAdminInsertConfig" type="controller" />
<action name="procAdvanced_mailerAdminInsertExceptions" type="controller" />
<action name="procAdvanced_mailerAdminCheckDNSRecord" type="controller" />
<action name="procAdvanced_mailerAdminClearSentMail" type="controller" />
<action name="procAdvanced_mailerAdminTestSend" type="controller" />
<action name="procAdvanced_mailerAdminTestSendMail" type="controller" />
</actions>
<menus>
<menu name="advanced_mailer" type="all">

View file

@ -1,12 +1,14 @@
<?php
$lang->cmd_advanced_mailer = 'Advanced Mailer';
$lang->cmd_advanced_mailer = 'Advanced Mailer (with SMS)';
$lang->cmd_advanced_mailer_general_config = 'General settings';
$lang->cmd_advanced_mailer_is_enabled = 'Enable module';
$lang->cmd_advanced_mailer_is_enabled_yes = 'Enabled';
$lang->cmd_advanced_mailer_is_enabled_no = 'Disabled';
$lang->cmd_advanced_mailer_logging = 'Logging';
$lang->cmd_advanced_mailer_log_sent_mail = 'Log Sent Mail';
$lang->cmd_advanced_mailer_log_errors = 'Log Errors';
$lang->cmd_advanced_mailer_log_mail = 'Log Mail';
$lang->cmd_advanced_mailer_log_mail_errors = 'Log Mail Errors';
$lang->cmd_advanced_mailer_log_sms = 'Log SMS';
$lang->cmd_advanced_mailer_log_sms_errors = 'Log SMS Errors';
$lang->cmd_advanced_mailer_log_yes = 'Yes';
$lang->cmd_advanced_mailer_log_no = 'No';
$lang->cmd_advanced_mailer_sending_method_config = 'Default Sending Method';
@ -62,7 +64,7 @@ $lang->cmd_advanced_mailer_other_info_mailgun_dkim = 'The DKIM hostname may be d
$lang->cmd_advanced_mailer_other_info_postmark_dkim = 'Please see the Sender Signatures page of your Postmark account for the exact DKIm hostname to use.';
$lang->cmd_advanced_mailer_other_info_woorimail_dkim = 'Please log into Woorimail to see your DKIM settings.';
$lang->cmd_advanced_mailer_ellipsis = '(see API for full value)';
$lang->cmd_advanced_mailer_test = 'Mail Test';
$lang->cmd_advanced_mailer_mail_test = 'Mail Test';
$lang->cmd_advanced_mailer_recipient_name = 'Recipient\'s name';
$lang->cmd_advanced_mailer_recipient_email = 'Recipient\'s email';
$lang->cmd_advanced_mailer_send = 'Send';
@ -115,3 +117,4 @@ $lang->cmd_advanced_mailer_status_calling_script = 'Called from';
$lang->cmd_advanced_mailer_clear_log_condition_all = 'Everything';
$lang->cmd_advanced_mailer_clear_log_condition = 'Over %d days';
$lang->cmd_advanced_mailer_clear_log_button = 'Clear old logs';
$lang->cmd_advanced_mailer_sms_test = 'SMS Test';

View file

@ -1,12 +1,14 @@
<?php
$lang->cmd_advanced_mailer = '고급 메일 발송 모듈';
$lang->cmd_advanced_mailer = '고급 메일 발송 모듈 (메일 및 SMS 관리)';
$lang->cmd_advanced_mailer_general_config = '기본 설정';
$lang->cmd_advanced_mailer_is_enabled = '모듈 사용';
$lang->cmd_advanced_mailer_is_enabled_yes = '사용';
$lang->cmd_advanced_mailer_is_enabled_no = '사용하지 않음';
$lang->cmd_advanced_mailer_logging = '발송 내역 기록';
$lang->cmd_advanced_mailer_log_sent_mail = '발송 내역';
$lang->cmd_advanced_mailer_log_errors = '에러 내역';
$lang->cmd_advanced_mailer_log_mail = '메일 발송 내역';
$lang->cmd_advanced_mailer_log_mail_errors = '메일 에러 내역';
$lang->cmd_advanced_mailer_log_sms = 'SMS 발송 내역';
$lang->cmd_advanced_mailer_log_sms_errors = 'SMS 에러 내역';
$lang->cmd_advanced_mailer_log_yes = '기록';
$lang->cmd_advanced_mailer_log_no = '기록하지 않음';
$lang->cmd_advanced_mailer_sending_method_config = '기본 발송 방법 설정';
@ -62,7 +64,7 @@ $lang->cmd_advanced_mailer_other_info_mailgun_dkim = 'DKIM 호스트명은 달
$lang->cmd_advanced_mailer_other_info_postmark_dkim = '정확한 DKIM 호스트명은 Postmark 계정의 Sender Signatures 페이지를 참고하시기 바랍니다.';
$lang->cmd_advanced_mailer_other_info_woorimail_dkim = 'DKIM 설정은 우리메일에 로그인하여 확인하십시오.';
$lang->cmd_advanced_mailer_ellipsis = '(중략)';
$lang->cmd_advanced_mailer_test = '발송 테스트';
$lang->cmd_advanced_mailer_mail_test = '메일 테스트';
$lang->cmd_advanced_mailer_recipient_name = '받는이 이름';
$lang->cmd_advanced_mailer_recipient_email = '받는이 메일 주소';
$lang->cmd_advanced_mailer_send = '발송';
@ -115,3 +117,4 @@ $lang->cmd_advanced_mailer_status_calling_script = '호출 위치';
$lang->cmd_advanced_mailer_clear_log_condition_all = '모두';
$lang->cmd_advanced_mailer_clear_log_condition = '%d일 이상';
$lang->cmd_advanced_mailer_clear_log_button = '오래된 기록 삭제';
$lang->cmd_advanced_mailer_sms_test = 'SMS 테스트';

View file

@ -7,7 +7,10 @@
<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>
<li class="x_active"|cond="$act == 'dispAdvanced_mailerAdminMailTest'"><a href="{getUrl('', 'module', 'admin', 'act', 'dispAdvanced_mailerAdminMailTest')}">{$lang->cmd_advanced_mailer_mail_test}</a></li>
<li class="x_active"|cond="$act == 'dispAdvanced_mailerAdminMailLog'"><a href="{getUrl('', 'module', 'admin', 'act', 'dispAdvanced_mailerAdminMailLog')}">{$lang->cmd_advanced_mailer_log_mail}</a></li>
<li class="x_active"|cond="$act == 'dispAdvanced_mailerAdminMailErrors'"><a href="{getUrl('', 'module', 'admin', 'act', 'dispAdvanced_mailerAdminMailErrors')}">{$lang->cmd_advanced_mailer_log_mail_errors}</a></li>
<li class="x_active"|cond="$act == 'dispAdvanced_mailerAdminTestSMS'"><a href="{getUrl('', 'module', 'admin', 'act', 'dispAdvanced_mailerAdminTestSMS')}">{$lang->cmd_advanced_mailer_sms_test}</a></li>
<li class="x_active"|cond="$act == 'dispAdvanced_mailerAdminSentSMS'"><a href="{getUrl('', 'module', 'admin', 'act', 'dispAdvanced_mailerAdminSentSMS')}">{$lang->cmd_advanced_mailer_log_sms}</a></li>
<li class="x_active"|cond="$act == 'dispAdvanced_mailerAdminSMSErrors'"><a href="{getUrl('', 'module', 'admin', 'act', 'dispAdvanced_mailerAdminSMSErrors')}">{$lang->cmd_advanced_mailer_log_sms_errors}</a></li>
</ul>

View file

@ -36,7 +36,7 @@
<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>
<label class="x_control-label" for="advanced_mailer_log_sent_mail">{$lang->cmd_advanced_mailer_log_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>
@ -46,7 +46,7 @@
</div>
<div class="x_control-group">
<label class="x_control-label">{$lang->cmd_advanced_mailer_log_errors}</label>
<label class="x_control-label">{$lang->cmd_advanced_mailer_log_mail_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>
@ -55,6 +55,26 @@
</div>
</div>
<div class="x_control-group">
<label class="x_control-label" for="advanced_mailer_log_sent_sms">{$lang->cmd_advanced_mailer_log_sms}</label>
<div class="x_controls">
<select name="log_sent_sms" id="advanced_mailer_log_sent_sms">
<option value="Y" selected="selected"|cond="toBool($advanced_mailer_config->log_sent_sms)" />{$lang->cmd_advanced_mailer_log_yes}</option>
<option value="N" selected="selected"|cond="!toBool($advanced_mailer_config->log_sent_sms)" />{$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_sms_errors}</label>
<div class="x_controls">
<select name="log_sms_errors" id="advanced_mailer_log_sms_errors">
<option value="Y" selected="selected"|cond="toBool($advanced_mailer_config->log_sms_errors)" />{$lang->cmd_advanced_mailer_log_yes}</option>
<option value="N" selected="selected"|cond="!toBool($advanced_mailer_config->log_sms_errors)" />{$lang->cmd_advanced_mailer_log_no}</option>
</select>
</div>
</div>
</section>
<div class="btnArea x_clearfix">

View file

@ -3,7 +3,7 @@
$(function() {
$("#advanced_mailer_test_send").click(function(event) {
$("#advanced_mailer_test_send_mail").click(function(event) {
event.preventDefault();
$("#advanced_mailer_test_result").text("");
$(this).attr("disabled", "disabled");
@ -12,7 +12,7 @@
recipient_email: $("#advanced_mailer_recipient_email").val(),
};
$.exec_json(
"advanced_mailer.procAdvanced_mailerAdminTestSend", ajax_data,
"advanced_mailer.procAdvanced_mailerAdminTestSendMail", ajax_data,
function(response) {
$("#advanced_mailer_test_result").html(response.test_result);
$("#advanced_mailer_test_send").removeAttr("disabled");

View file

@ -13,7 +13,7 @@
<section class="section">
<h2>{$lang->cmd_advanced_mailer_test}</h2>
<h2>{$lang->cmd_advanced_mailer_mail_test}</h2>
<div class="x_control-group">
<label class="x_control-label" for="advanced_mailer_recipient_name">{$lang->cmd_advanced_mailer_recipient_name}</label>
@ -39,7 +39,7 @@
</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>
<button id="advanced_mailer_test_send_mail" type="submit" class="x_btn x_btn-primary x_pull-right">{$lang->cmd_advanced_mailer_send}</button>
</div>
</form>