메뉴 건너뛰기

app

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

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

댓글 달기

suritam9
2013.04.25 조회 6115
suritam9
2013.04.04 조회 2197
suritam9
2012.09.14 조회 2515
suritam9
2012.06.24 조회 2366
suritam9
2012.06.24 조회 2777
suritam9
2012.06.24 조회 2538
suritam9
2012.06.22 조회 2582
박영식
2011.09.22 조회 2544
박영식
2011.09.21 조회 2488
박영식
2011.02.18 조회 2964
박영식
2010.09.29 조회 4757
첨부 (0)
위로