Можно вот так сделать
public function notifyParent($comment, $parent_comment){ if ($comment['user_id'] && ($comment['user_id'] == $parent_comment['user_id'])) { return; } $messenger = cmsCore::getController('messages'); $page_url = href_to($comment['target_url']) . "#comment_{$comment['id']}"; $page_url_mail = href_to_abs($comment['target_url']) . "#comment_{$comment['id']}"; 'title' => LANG_SHOW, 'href' => href_to( $page_url ) ),)); if (!$is_guest_parent){ $messenger->addRecipient($parent_comment['user_id']); $messenger->sendNoticePM($notice,'comments_reply'); } if ($is_guest_parent){ $letter_data['nickname'] = $parent_comment['author_name']; $messenger->sendEmail($to, $letter, $notice); } 'page_url' => $page_url_mail, 'page_title' => $comment['target_title'], 'author_url' => $is_guest_comment ? $page_url : href_to_abs('users', $comment['user_id']), 'author_nickname' => $is_guest_comment ? $comment['author_name'] : $comment['user_nickname'], 'comment' => $comment['content'], 'original' => $parent_comment['content'], ); if (!$is_guest_parent){ $messenger->addRecipient($parent_comment['user_id']); $messenger->sendNoticeEmail('comments_reply', $letter_data); } if ($is_guest_parent){ $letter_data['nickname'] = $parent_comment['author_name']; $messenger->sendEmail($to, $letter, $letter_data); } }
Надо дальше разбираться…