Modify the title of the comment notification e-mail.

This commit is contained in:
BJRambo 2016-07-30 07:49:30 +09:00
parent 68abd0e986
commit bcf6523e81
3 changed files with 13 additions and 10 deletions

View file

@ -638,16 +638,22 @@ class commentController extends comment
$module_info = $oModuleModel->getModuleInfoByDocumentSrl($obj->document_srl); $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 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(); $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); $oMail->setTitle($mail_title);
$url_comment = getFullUrl('','document_srl',$obj->document_srl).'#comment_'.$obj->comment_srl; $url_comment = getFullUrl('','document_srl',$obj->document_srl).'#comment_'.$obj->comment_srl;
if($using_validation) if($using_validation)
@ -710,7 +716,6 @@ class commentController extends comment
// get all admins emails // get all admins emails
$admins_emails = $module_info->admin_mail; $admins_emails = $module_info->admin_mail;
$target_mail = explode(',', $admins_emails); $target_mail = explode(',', $admins_emails);
// send email to all admins - START // send email to all admins - START
for($i = 0; $i < count($target_mail); $i++) for($i = 0; $i < count($target_mail); $i++)
{ {
@ -719,10 +724,6 @@ class commentController extends comment
{ {
continue; continue;
} }
if(!$is_logged)
{
$oMail->setSender($email_address, $email_address);
}
$oMail->setReceiptor($email_address, $email_address); $oMail->setReceiptor($email_address, $email_address);
$oMail->send(); $oMail->send();
} }

View file

@ -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->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_deleted_comment = 'This comment has been deleted.';
$lang->msg_admin_deleted_comment = 'This comment has been deleted by an administrator.'; $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 \"";

View file

@ -53,3 +53,4 @@ $lang->improper_comment_reasons['others'] = '기타(직접작성)';
$lang->about_improper_comment_declare = '댓글을 신고하신 이유를 간단히 적어서 제출해주시면 관리자 검토 후 조치하겠습니다.'; $lang->about_improper_comment_declare = '댓글을 신고하신 이유를 간단히 적어서 제출해주시면 관리자 검토 후 조치하겠습니다.';
$lang->msg_deleted_comment = '삭제된 댓글입니다.'; $lang->msg_deleted_comment = '삭제된 댓글입니다.';
$lang->msg_admin_deleted_comment = '관리자가 삭제한 댓글입니다.'; $lang->msg_admin_deleted_comment = '관리자가 삭제한 댓글입니다.';
$lang->msg_comment_notify_mail = '[%s] 새로운 댓글이 등록되었습니다 : %s';