메뉴 건너뛰기

app

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

lispro062015.05.15 11:22조회 수 1262댓글 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 (비회원)
    • 글자 크기

댓글 달기

박영식
2006.09.01 조회 1412
lispro06
2015.05.15 조회 1453
lispro06
2015.05.15 조회 1467
lispro06
2015.11.20 조회 1471
lispro06
2013.12.11 조회 1484
suritam9
2013.11.26 조회 1490
lispro06
2016.11.02 조회 1566
lispro06
2014.08.16 조회 1568
lispro06
2017.07.16 조회 1593
이전 1 2 3 4 5 6 7 8 9 10... 14다음
첨부 (0)
위로