From bcf6523e81e28893fff888b30202cddaab355518 Mon Sep 17 00:00:00 2001 From: BJRambo Date: Sat, 30 Jul 2016 07:49:30 +0900 Subject: [PATCH 1/5] Modify the title of the comment notification e-mail. --- modules/comment/comment.controller.php | 21 +++++++++++---------- modules/comment/lang/en.php | 1 + modules/comment/lang/ko.php | 1 + 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/modules/comment/comment.controller.php b/modules/comment/comment.controller.php index 402063609..8e62e49bf 100644 --- a/modules/comment/comment.controller.php +++ b/modules/comment/comment.controller.php @@ -638,16 +638,22 @@ class commentController extends comment $module_info = $oModuleModel->getModuleInfoByDocumentSrl($obj->document_srl); // If there is no problem to register comment then send an email to all admin were set in module admin panel - if($module_info->admin_mail && $member_info->is_admin != 'Y') + if($module_info->admin_mail/* && $member_info->is_admin != 'Y'*/) { $oMail = new Mail(); - if($is_logged) + // 메일 발신자 조작으로 취급하여 스팸으로 직행할 수 있기때문에 회원설정에서 입력된 웹마스터 메일주소를 이용하도록 함 + $member_config = $oMemberModel->getMemberConfig(); + $admin_email_adress = $member_config->webmaster_email; + // 관리자 메일을 입력하지 않으면 메일을 보내지 않음. + if(!$admin_email_adress) { - $oMail->setSender($obj->email_address, $obj->email_address); + return; } - - $mail_title = "[Rhymix - " . Context::get('mid') . "] A new comment was posted on document: \"" . $oDocument->getTitleText() . "\""; + // 매일 보내는 이를 관리자 계정으로 설정한다. + $oMail->setSender($member_config->webmaster_name, $member_config->webmaster_email); + $mail_title = sprintf(lang('msg_comment_notify_mail'), Context::get('mid'), $oDocument->getTitleText()); + //$mail_title = "[" . Context::get('mid') . "] A new comment was posted on document: \"" . $oDocument->getTitleText() . "\""; $oMail->setTitle($mail_title); $url_comment = getFullUrl('','document_srl',$obj->document_srl).'#comment_'.$obj->comment_srl; if($using_validation) @@ -710,7 +716,6 @@ class commentController extends comment // get all admins emails $admins_emails = $module_info->admin_mail; $target_mail = explode(',', $admins_emails); - // send email to all admins - START for($i = 0; $i < count($target_mail); $i++) { @@ -719,10 +724,6 @@ class commentController extends comment { continue; } - if(!$is_logged) - { - $oMail->setSender($email_address, $email_address); - } $oMail->setReceiptor($email_address, $email_address); $oMail->send(); } diff --git a/modules/comment/lang/en.php b/modules/comment/lang/en.php index dea93e25d..16a36ed3c 100644 --- a/modules/comment/lang/en.php +++ b/modules/comment/lang/en.php @@ -49,3 +49,4 @@ $lang->improper_comment_reasons['others'] = 'Others (Write your own)'; $lang->about_improper_comment_declare = 'Write here why you report this comment as an improper thing.'; $lang->msg_deleted_comment = 'This comment has been deleted.'; $lang->msg_admin_deleted_comment = 'This comment has been deleted by an administrator.'; +$lang->msg_comment_notify_mail = "[%s] A new comment was posted on document: \" %s \""; diff --git a/modules/comment/lang/ko.php b/modules/comment/lang/ko.php index 0ad2e16b2..59e7cb8f1 100644 --- a/modules/comment/lang/ko.php +++ b/modules/comment/lang/ko.php @@ -53,3 +53,4 @@ $lang->improper_comment_reasons['others'] = '기타(직접작성)'; $lang->about_improper_comment_declare = '댓글을 신고하신 이유를 간단히 적어서 제출해주시면 관리자 검토 후 조치하겠습니다.'; $lang->msg_deleted_comment = '삭제된 댓글입니다.'; $lang->msg_admin_deleted_comment = '관리자가 삭제한 댓글입니다.'; +$lang->msg_comment_notify_mail = '[%s] 새로운 댓글이 등록되었습니다 : %s'; From e4140c51622f16ac5594198b1627504905dbd284 Mon Sep 17 00:00:00 2001 From: BJRambo Date: Sat, 30 Jul 2016 07:56:49 +0900 Subject: [PATCH 2/5] Deleted test code --- modules/comment/comment.controller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/comment/comment.controller.php b/modules/comment/comment.controller.php index 8e62e49bf..695195c20 100644 --- a/modules/comment/comment.controller.php +++ b/modules/comment/comment.controller.php @@ -638,7 +638,7 @@ class commentController extends comment $module_info = $oModuleModel->getModuleInfoByDocumentSrl($obj->document_srl); // If there is no problem to register comment then send an email to all admin were set in module admin panel - if($module_info->admin_mail/* && $member_info->is_admin != 'Y'*/) + if($module_info->admin_mail && $member_info->is_admin != 'Y') { $oMail = new Mail(); From c1e62d93c7d1b1363894981652bb5c9a79750204 Mon Sep 17 00:00:00 2001 From: BJRambo Date: Sat, 30 Jul 2016 08:11:09 +0900 Subject: [PATCH 3/5] Improvement to cut the post title --- modules/comment/comment.controller.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/comment/comment.controller.php b/modules/comment/comment.controller.php index 695195c20..45a588f82 100644 --- a/modules/comment/comment.controller.php +++ b/modules/comment/comment.controller.php @@ -652,8 +652,7 @@ class commentController extends comment } // 매일 보내는 이를 관리자 계정으로 설정한다. $oMail->setSender($member_config->webmaster_name, $member_config->webmaster_email); - $mail_title = sprintf(lang('msg_comment_notify_mail'), Context::get('mid'), $oDocument->getTitleText()); - //$mail_title = "[" . Context::get('mid') . "] A new comment was posted on document: \"" . $oDocument->getTitleText() . "\""; + $mail_title = sprintf(lang('msg_comment_notify_mail'), Context::get('mid'), cut_str($oDocument->getTitleText(), 20, '...')); $oMail->setTitle($mail_title); $url_comment = getFullUrl('','document_srl',$obj->document_srl).'#comment_'.$obj->comment_srl; if($using_validation) From 0c2c3b80ac8c6cc0deea16ceef50ddc3c116ad9a Mon Sep 17 00:00:00 2001 From: BJRambo Date: Sat, 30 Jul 2016 08:23:58 +0900 Subject: [PATCH 4/5] Fixed the format of the notifycation e-mail for new posts --- modules/board/board.controller.php | 31 +++++++++++++++--------------- modules/board/lang/en.php | 1 + modules/board/lang/ko.php | 1 + 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/modules/board/board.controller.php b/modules/board/board.controller.php index ada9c426a..a7afd54d3 100644 --- a/modules/board/board.controller.php +++ b/modules/board/board.controller.php @@ -177,26 +177,27 @@ class boardController extends board { $oModuleModel = getModel('module'); $member_config = $oModuleModel->getModuleConfig('member'); - $is_logged = Context::get('is_logged'); - if(!$is_logged && !$member_config->webmaster_email) + if($member_config->webmaster_email) { - $obj->email_address = $this->module_info->admin_mail; + $mail_title = sprintf(lang('msg_document_notify_mail'), $obj->mid, cut_str($obj->title, 20, '...')); + + $oMail = new Mail(); + $oMail->setTitle($mail_title); + $oMail->setContent( sprintf("From : %s
\r\n%s", getFullUrl('','document_srl',$obj->document_srl), getFullUrl('','document_srl',$obj->document_srl), $obj->content)); + $oMail->setSender($member_config->webmaster_name ?: null, $member_config->webmaster_email); + + $target_mail = explode(',',$this->module_info->admin_mail); + for($i=0;$isetReceiptor($email_address, $email_address); + $oMail->send(); + } } - $oMail = new Mail(); - $oMail->setTitle($obj->title); - $oMail->setContent( sprintf("From : %s
\r\n%s", getFullUrl('','document_srl',$obj->document_srl), getFullUrl('','document_srl',$obj->document_srl), $obj->content)); - $oMail->setSender($obj->user_name ?: null, $obj->email_address ? $obj->email_address : $member_config->webmaster_email); - $target_mail = explode(',',$this->module_info->admin_mail); - for($i=0;$isetReceiptor($email_address, $email_address); - $oMail->send(); - } } } diff --git a/modules/board/lang/en.php b/modules/board/lang/en.php index 303b1171f..108f4589c 100644 --- a/modules/board/lang/en.php +++ b/modules/board/lang/en.php @@ -48,3 +48,4 @@ $lang->cmd_only_p_comment = 'Only if there are replies'; $lang->cmd_all_comment_message = 'Always'; $lang->cmd_do_not_message = 'Never'; $lang->delete_placeholder = 'Delete Placeholder'; +$lang->msg_document_notify_mail = '[%s] The new post : %s'; diff --git a/modules/board/lang/ko.php b/modules/board/lang/ko.php index b7a7a36e4..42b8b5fb5 100644 --- a/modules/board/lang/ko.php +++ b/modules/board/lang/ko.php @@ -77,3 +77,4 @@ $lang->cmd_only_p_comment = '대댓글이 있는 경우에만 남김'; $lang->cmd_all_comment_message = '모든 댓글에 남김'; $lang->cmd_do_not_message = '남기지 않음'; $lang->delete_placeholder = '완전 삭제'; +$lang->msg_document_notify_mail = '[%s] 새로운 게시글이 등록되었습니다 : %s'; From a7cc0b64b8c74a72d4109596e69879e76debbb5d Mon Sep 17 00:00:00 2001 From: BJRambo Date: Mon, 1 Aug 2016 13:22:47 +0900 Subject: [PATCH 5/5] =?UTF-8?q?=EB=AA=A8=EB=93=88=EC=9D=98=20mid=EB=A5=BC?= =?UTF-8?q?=20=EB=82=98=ED=83=80=EB=82=B4=EC=A7=80=20=EC=95=8A=EA=B3=A0=20?= =?UTF-8?q?=EB=B8=8C=EB=9D=BC=EC=9A=B0=EC=A0=80=20=ED=83=80=EC=9D=B4?= =?UTF-8?q?=ED=8B=80=EC=9D=84=20=EC=B6=9C=EB=A0=A5=ED=95=98=EB=8F=84?= =?UTF-8?q?=EB=A1=9D=20=EA=B3=A0=EC=B9=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/board/board.controller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/board/board.controller.php b/modules/board/board.controller.php index a7afd54d3..738cb5767 100644 --- a/modules/board/board.controller.php +++ b/modules/board/board.controller.php @@ -180,7 +180,7 @@ class boardController extends board if($member_config->webmaster_email) { - $mail_title = sprintf(lang('msg_document_notify_mail'), $obj->mid, cut_str($obj->title, 20, '...')); + $mail_title = sprintf(lang('msg_document_notify_mail'), $this->module_info->browser_title, cut_str($obj->title, 20, '...')); $oMail = new Mail(); $oMail->setTitle($mail_title);