메뉴 건너뛰기

app

[XE] 코멘트를 관리자 메일로 보내는 소스

lispro062015.05.15 11:22조회 수 1580댓글 0

    • 글자 크기
/modules/comment/comment.controller.php & comment.admin.controller.php
에서 처리된다. 주석처리도 많이 되어 있고, 수정하다가 그만 둔 흔적이 보인다.
적당히 수정해서 쓰면 좋다.

if($module_info->admin_mail && $member_info->is_admin != 'Y')
{
$oMail = new Mail();
$oMail->setSender($obj->email_address, $obj->email_address);
$mail_title = "[XE - " . Context::get('mid') . "] A new comment was posted on document: "" . $oDocument->getTitleText() . """;
$oMail->setTitle($mail_title);
if($using_validation)
{
$url_approve = getFullUrl('', 'module', 'comment', 'act', 'procCommentAdminChangePublishedStatusChecked', 'cart[]', $obj->comment_srl, 'will_publish', '1', 'search_target', 'is_published', 'search_keyword', 'N');
$url_trash = getFullUrl('', 'module', 'comment', 'act', 'procCommentAdminDeleteChecked', 'cart[]', $obj->comment_srl, 'search_target', 'is_trash', 'search_keyword', 'true');
$mail_content = "
A new comment on the document "" . $oDocument->getTitleText() . "" is waiting for your approval.
<br />
<br />
Author: " . $member_info->nick_name . "
<br />Author e-mail: " . $member_info->email_address . "
<br />Comment:
<br />"" . $obj->content . ""
<br />
<br />
Approve it: <a href="" . $url_approve . "">" . $url_approve . "</a>
<br />Trash it: <a href="" . $url_trash . "">" . $url_trash . "</a>
<br />Currently " . $nr_comments_not_approved . " comments on "" . Context::get('mid') . "" module are waiting for approval. Please visit the moderation panel:
<br /><a href="" . getFullUrl('', 'module', 'admin', 'act', 'dispCommentAdminList', 'search_target', 'module', 'search_keyword', $obj->module_srl) . "">" . getFullUrl('', 'module', 'admin', 'act', 'dispCommentAdminList', 'search_target', 'module', 'search_keyword', $obj->module_srl) . "</a>
";
$oMail->setContent($mail_content);
}
else
{
$mail_content = "
Author: " . $member_info->nick_name . "
<br />Author e-mail: " . $member_info->email_address . "
<br />Comment:
<br />"" . $obj->content . ""
";
$oMail->setContent($mail_content);

// get email of thread's author
$document_author_email = $oDocument->variables['email_address'];

//get admin info
$logged_info = Context::get('logged_info');

//mail to author of thread - START
if($document_author_email != $obj->email_address && $logged_info->email_address != $document_author_email)
{
$oMail->setReceiptor($document_author_email, $document_author_email);
$oMail->send();
}
// mail to author of thread - STOP
}

// 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++)
{
$email_address = trim($target_mail[$i]);
if(!$email_address)
{
continue;
}

$oMail->setReceiptor($email_address, $email_address);
$oMail->send();
}
//  send email to all admins - STOP
}
lispro06 (비회원)
    • 글자 크기
shell in a box (by lispro06) [톰캣] 한글 사용 및 mysql 연동 (by lispro06)

댓글 달기

lispro06
2015.05.15 조회 1696
lispro06
2015.05.15 조회 1666
lispro06
2015.05.15 조회 2559
lispro06
2014.08.16 조회 1803
lispro06
2014.02.08 조회 4082
lispro06
2013.12.11 조회 1731
lispro06
2013.12.10 조회 3036
suritam9
2013.12.06 조회 2314
suritam9
2013.12.02 조회 3500
suritam9
2013.11.30 조회 2197
suritam9
2013.11.26 조회 1702
suritam9
2013.08.23 조회 7372
suritam9
2013.08.23 조회 1903
suritam9
2013.06.28 조회 2391
첨부 (0)
위로