本文整理汇总了PHP中Mail::setReceiptor方法的典型用法代码示例。如果您正苦于以下问题:PHP Mail::setReceiptor方法的具体用法?PHP Mail::setReceiptor怎么用?PHP Mail::setReceiptor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mail
的用法示例。
在下文中一共展示了Mail::setReceiptor方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sendMailMessage
/**
* send email
*/
function sendMailMessage($title, $message, $recipientName, $recipientEmailAddress, $senderName, $senderEmailAddress)
{
$oMail = new Mail();
$oMail->setTitle($title);
$oMail->setContent($message);
$oMail->setSender($senderName, $senderEmailAddress);
$oMail->setReceiptor($recipientName, $recipientEmailAddress);
$oMail->send();
}
示例2: sendMessages
function sendMessages($content, $mail_content, $title, $sender, $config)
{
$oTextmessageController = &getController('textmessage');
$oPaynotyModel = &getModel('paynoty');
if (in_array($config->sending_method,array('1','2'))&&$oTextmessageController)
{
$args->recipient_no = explode(',',$config->admin_phones);
//$args->sender_no = $receiver->recipient_no;
$args->content = $content;
$output = $oTextmessageController->sendMessage($args);
if (!$output->toBool()) return $output;
}
if (in_array($config->sending_method,array('1','3')))
{
if ($config->sender_email)
{
$sender_email_address = $config->sender_email;
}
else
{
$sender_email_address = $sender->email_address;
}
if ($config->sender_name)
{
$sender_name = $config->sender_name;
}
else
{
$sender_name = $sender->nick_name;
}
$oMail = new Mail();
$oMail->setTitle($title);
$oMail->setContent($mail_content);
$oMail->setSender($sender_name, $sender_email_address);
$target_email = explode(',',$config->admin_emails);
foreach ($target_email as $email_address)
{
$email_address = trim($email_address);
if (!$email_address) continue;
$oMail->setReceiptor($email_address, $email_address);
$oMail->send();
}
}
return new Object();
}
示例3: procCommunicationSendMessage
/**
* Send a message
* @return Object
**/
function procCommunicationSendMessage()
{
// Check login information
if (!Context::get('is_logged')) {
return new Object(-1, 'msg_not_logged');
}
$logged_info = Context::get('logged_info');
// Check variables
$receiver_srl = Context::get('receiver_srl');
if (!$receiver_srl) {
return new Object(-1, 'msg_not_exists_member');
}
$title = trim(Context::get('title'));
if (!$title) {
return new Object(-1, 'msg_title_is_null');
}
$content = trim(Context::get('content'));
if (!$content) {
return new Object(-1, 'msg_content_is_null');
}
$send_mail = Context::get('send_mail');
if ($send_mail != 'Y') {
$send_mail = 'N';
}
// Check if there is a member to receive a message
$oMemberModel =& getModel('member');
$oCommunicationModel =& getModel('communication');
$receiver_member_info = $oMemberModel->getMemberInfoByMemberSrl($receiver_srl);
if ($receiver_member_info->member_srl != $receiver_srl) {
return new Object(-1, 'msg_not_exists_member');
}
// check whether to allow to receive the message(pass if a top-administrator)
if ($logged_info->is_admin != 'Y') {
if ($receiver_member_info->allow_message == 'F') {
if (!$oCommunicationModel->isFriend($receiver_member_info->member_srl)) {
return new object(-1, 'msg_allow_message_to_friend');
}
} elseif ($receiver_member_info->allow_message == 'N') {
return new object(-1, 'msg_disallow_message');
}
}
// send a message
$output = $this->sendMessage($logged_info->member_srl, $receiver_srl, $title, $content);
// send an e-mail
if ($output->toBool() && $send_mail == 'Y') {
$view_url = Context::getRequestUri();
$content = sprintf("%s<br /><br />From : <a href=\"%s\" target=\"_blank\">%s</a>", $content, $view_url, $view_url);
$oMail = new Mail();
$oMail->setTitle($title);
$oMail->setContent($content);
$oMail->setSender($logged_info->nick_name, $logged_info->email_address);
$oMail->setReceiptor($receiver_member_info->nick_name, $receiver_member_info->email_address);
$oMail->send();
}
if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) {
global $lang;
htmlHeader();
alertScript($lang->success_sended);
closePopupScript();
htmlFooter();
Context::close();
exit;
}
return $output;
}
示例4: importMember
//.........这里部分代码省略.........
$obj->point = base64_decode($xmlObj->member->point->body);
$obj->image_nickname = base64_decode($xmlObj->member->image_nickname->buff->body);
$obj->image_mark = base64_decode($xmlObj->member->image_mark->buff->body);
$obj->profile_image = base64_decode($xmlObj->member->profile_image->buff->body);
$obj->signature = base64_decode($xmlObj->member->signature->body);
$obj->regdate = base64_decode($xmlObj->member->regdate->body);
$obj->last_login = base64_decode($xmlObj->member->last_login->body);
if ($xmlObj->member->extra_vars) {
foreach ($xmlObj->member->extra_vars as $key => $val) {
if (in_array($key, array('node_name', 'attrs', 'body'))) {
continue;
}
$obj->extra_vars->{$key} = base64_decode($val->body);
}
}
// Create url for homepage and blog
if ($obj->homepage && strncasecmp('http://', $obj->homepage, 7) !== 0 && strncasecmp('https://', $obj->homepage, 8) !== 0) {
$obj->homepage = 'http://' . $obj->homepage;
}
// email address column
$obj->email_address = $obj->email;
list($obj->email_id, $obj->email_host) = explode('@', $obj->email);
// Set the mailing option
if ($obj->allow_mailing != 'Y') {
$obj->allow_mailing = 'N';
}
// Set the message option
$obj->allow_message = 'Y';
if (!in_array($obj->allow_message, array('Y', 'N', 'F'))) {
$obj->allow_message = 'Y';
}
// Get member-join date if the last login time is not found
if (!$obj->last_login) {
$obj->last_login = $obj->regdate;
}
// Get a member_srl
$obj->member_srl = getNextSequence();
$obj->list_order = -1 * $obj->member_srl;
// List extra vars
$extra_vars = $obj->extra_vars;
unset($obj->extra_vars);
$obj->extra_vars = serialize($extra_vars);
// Check if the same nickname is existing
$nick_args = new stdClass();
$nick_args->nick_name = $obj->nick_name;
$nick_output = executeQuery('member.getMemberSrl', $nick_args);
if (!$nick_output->toBool()) {
$obj->nick_name .= '_' . $obj->member_srl;
}
// Add a member
$output = executeQuery('member.insertMember', $obj);
if ($output->toBool() && !$obj->password) {
// Send a mail telling the user to reset his password.
$oMail = new Mail();
$oMail->setTitle("Password update for your " . getFullSiteUrl() . " account");
$webmaster_name = $member_config->webmaster_name ? $member_config->webmaster_name : 'Webmaster';
$oMail->setContent("Dear {$obj->user_name}, <br /><br />\n\t\t\t\t\t\tWe recently migrated our phpBB forum to XpressEngine. Since you password was encrypted we could not migrate it too, so please reset it by following this link:\n\t\t\t\t\t\t<a href='" . getFullSiteUrl() . "/?act=dispMemberFindAccount' >" . getFullSiteUrl() . "?act=dispMemberFindAccount</a>. You need to enter you email address and hit the 'Find account' button. You will then receive an email with a new, generated password that you can change after login. <br /><br />\n\n\t\t\t\t\t\tThank you for your understanding,<br />\n\t\t\t\t\t\t{$webmaster_name}");
$oMail->setSender($webmaster_name, $member_config->webmaster_email);
$oMail->setReceiptor($obj->user_name, $obj->email);
$oMail->send();
}
// add group join/image name-mark-signiture and so on if a new member successfully added
if ($output->toBool()) {
// Join to the default group
$obj->group_srl = $default_group_srl;
executeQuery('member.addMemberToGroup', $obj);
// Image name
if ($obj->image_nickname) {
$target_path = sprintf('files/member_extra_info/image_name/%s/', getNumberingPath($obj->member_srl));
$target_filename = sprintf('%s%d.gif', $target_path, $obj->member_srl);
FileHandler::writeFile($target_filename, $obj->image_nickname);
}
// Image mark
if ($obj->image_mark && file_exists($obj->image_mark)) {
$target_path = sprintf('files/member_extra_info/image_mark/%s/', getNumberingPath($obj->member_srl));
$target_filename = sprintf('%s%d.gif', $target_path, $obj->member_srl);
FileHandler::writeFile($target_filename, $obj->image_mark);
}
// Profile image
if ($obj->profile_image) {
$target_path = sprintf('files/member_extra_info/profile_image/%s/', getNumberingPath($obj->member_srl));
$target_filename = sprintf('%s%d.gif', $target_path, $obj->member_srl);
FileHandler::writeFile($target_filename, $obj->profile_image);
}
// Signiture
if ($obj->signature) {
$signature = removeHackTag($obj->signature);
$signature_buff = sprintf('<?php if(!defined("__XE__")) exit();?>%s', $signature);
$target_path = sprintf('files/member_extra_info/signature/%s/', getNumberingPath($obj->member_srl));
if (!is_dir($target_path)) {
FileHandler::makeDir($target_path);
}
$target_filename = sprintf('%s%d.signature.php', $target_path, $obj->member_srl);
FileHandler::writeFile($target_filename, $signature_buff);
}
}
}
fclose($f);
return $idx - 1;
}
示例5: procCommentAdminChangeStatus
/**
* Change comment status
* @return void|object
*/
function procCommentAdminChangeStatus()
{
$will_publish = Context::get('will_publish');
// Error display if none is selected
$cart = Context::get('cart');
if (!$cart) {
return $this->stop('msg_cart_is_null');
}
if (!is_array($cart)) {
$comment_srl_list = explode('|@|', $cart);
} else {
$comment_srl_list = $cart;
}
$args = new stdClass();
$args->status = $will_publish;
$args->comment_srls_list = $comment_srl_list;
$output = executeQuery('comment.updatePublishedStatus', $args);
if (!$output->toBool()) {
return $output;
} else {
//update comment count for document
$updated_documents_arr = array();
// create the controller object of the document
$oDocumentController = getController('document');
// create the model object of the document
$oDocumentModel = getModel('document');
// create the comment model object
$oCommentModel = getModel('comment');
//get admin info
$logged_info = Context::get('logged_info');
//$oMemberModule = getModel("member");
//$logged_info = $oMemberModule->getMemberInfoByMemberSrl($logged_member_srl);
$new_status = $will_publish ? "published" : "unpublished";
foreach ($comment_srl_list as $comment_srl) {
// check if comment already exists
$comment = $oCommentModel->getComment($comment_srl);
if ($comment->comment_srl != $comment_srl) {
return new Object(-1, 'msg_invalid_request');
}
$document_srl = $comment->document_srl;
if (!in_array($document_srl, $updated_documents_arr)) {
$updated_documents_arr[] = $document_srl;
// update the number of comments
$comment_count = $oCommentModel->getCommentCount($document_srl);
// update comment count of the article posting
$output = $oDocumentController->updateCommentCount($document_srl, $comment_count, NULL, FALSE);
$oDocument = $oDocumentModel->getDocument($document_srl);
$author_email = $oDocument->variables['email_address'];
$oModuleModel = getModel("module");
$module_info = $oModuleModel->getModuleInfoByModuleSrl($comment->module_srl);
$already_sent = array();
// send email to comment's author, all admins and thread(document) subscribers - START
// -------------------------------------------------------
$oMail = new Mail();
$mail_title = "[XE - " . $module_info->mid . "] comment(s) status changed to " . $new_status . " on document: \"" . $oDocument->getTitleText() . "\"";
$oMail->setTitle($mail_title);
$mail_content = "\n\t\t\t\t\t\tThe comment #" . $comment_srl . " on document \"" . $oDocument->getTitleText() . "\" has been " . $new_status . " by admin of <strong><i>" . strtoupper($module_info->mid) . "</i></strong> module.\n\t\t\t\t\t\t<br />\n\t\t\t\t\t\t<br />Comment content:\n\t\t\t\t\t\t" . $comment->content . "\n\t\t\t\t\t\t<br />\n\t\t\t\t\t\t";
$oMail->setContent($mail_content);
$oMail->setSender($logged_info->user_name, $logged_info->email_address);
$document_author_email = $oDocument->variables['email_address'];
//mail to author of thread - START
/**
* @todo Removed code send email to document author.
*/
/*
if($document_author_email != $comment->email_address && $logged_info->email_address != $document_author_email)
{
$oMail->setReceiptor($document_author_email, $document_author_email);
$oMail->send();
$already_sent[] = $document_author_email;
}
*/
//mail to author of thread - STOP
//mail to all emails set for administrators - START
if ($module_info->admin_mail) {
$target_mail = explode(',', $module_info->admin_mail);
for ($i = 0; $i < count($target_mail); $i++) {
$email_address = trim($target_mail[$i]);
if (!$email_address) {
continue;
}
if ($author_email != $email_address) {
$oMail->setReceiptor($email_address, $email_address);
$oMail->send();
}
}
}
//mail to all emails set for administrators - STOP
}
// ----------------------------------------------------------
// send email to comment's author, all admins and thread(document) subscribers - STOP
}
// call a trigger for calling "send mail to subscribers" (for moment just for forum)
ModuleHandler::triggerCall("comment.procCommentAdminChangeStatus", "after", $comment_srl_list);
}
// for message send - start
//.........这里部分代码省略.........
示例6: procIssuetrackerInsertIssue
function procIssuetrackerInsertIssue()
{
// 권한 체크
if (!$this->grant->ticket_write) {
return new Object(-1, 'msg_not_permitted');
}
// 글작성시 필요한 변수를 세팅
$obj = Context::getRequestVars();
$obj->module_srl = $this->module_srl;
if (!$obj->title) {
$obj->title = cut_str(strip_tags($obj->content), 20, '...');
}
// 관리자가 아니라면 게시글 색상/굵기 제거
if (!$this->grant->manager) {
unset($obj->title_color);
unset($obj->title_bold);
}
// 커미터가 아니라면 마일스톤(계획), 우선순위, 소유자 설정 제거
// (이슈 상태는 여기서 건드릴수없음 / 종류, 컴포넌트, 패키지 설정은 ticket_write권한이면 가능)
if (!$this->grant->commiter) {
unset($obj->assignee_srl);
unset($obj->milestone_srl);
unset($obj->priority_srl);
}
if ($obj->release_srl) {
$obj->occured_version_srl = $obj->release_srl;
}
if ($obj->occured_version_srl == 0) {
unset($obj->occured_version_srl);
}
// document module의 model 객체 생성
$oDocumentModel =& getModel('document');
// document module의 controller 객체 생성
$oDocumentController =& getController('document');
// 이미 존재하는 글인지 체크
$oDocument = $oDocumentModel->getDocument($obj->document_srl, $this->grant->manager);
// 이미 존재하는 경우 수정
if ($oDocument->isExists() && $oDocument->document_srl == $obj->document_srl) {
$output = $oDocumentController->updateDocument($oDocument, $obj);
$msg_code = 'success_updated';
if (!$output->toBool()) {
return $output;
}
// 그렇지 않으면 신규 등록
} else {
// assignee name
$oMemberModel =& getModel('member');
$member_info = $oMemberModel->getMemberInfoByMemberSrl($obj->assignee_srl);
$obj->assignee_name = $member_info->nick_name;
// transaction start
$oDB =& DB::getInstance();
$oDB->begin();
$output = executeQuery("issuetracker.insertIssue", $obj);
if (!$output->toBool()) {
$oDB->rollback();
return $output;
}
$output = $oDocumentController->insertDocument($obj);
$msg_code = 'success_registed';
$obj->document_srl = $output->get('document_srl');
if (!$output->toBool()) {
$oDB->rollback();
return $output;
}
$oDB->commit();
// 문제가 없고 모듈 설정에 관리자 메일이 등록되어 있으면 메일 발송
if ($output->toBool() && $this->module_info->admin_mail) {
$oMail = new Mail();
$oMail->setTitle($obj->title);
$oMail->setContent(sprintf("From : <a href=\"%s\">%s</a><br/>\r\n%s", getUrl('', 'document_srl', $obj->document_srl), getUrl('', 'document_srl', $obj->document_srl), $obj->content));
$oMail->setSender($obj->user_name, $obj->email_address);
$target_mail = explode(',', $this->module_info->admin_mail);
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();
}
}
}
// 오류 발생시 멈춤
if (!$output->toBool()) {
return $output;
}
// 결과를 리턴
$this->add('mid', Context::get('mid'));
$this->add('document_srl', $output->get('document_srl'));
// 성공 메세지 등록
$this->setMessage($msg_code);
}
示例7: procMemberModifyEmailAddress
function procMemberModifyEmailAddress()
{
if (!Context::get('is_logged')) {
return $this->stop('msg_not_logged');
}
$member_info = Context::get('logged_info');
$newEmail = Context::get('email_address');
if (!$newEmail) {
return $this->stop('msg_invalid_request');
}
$oMemberModel = getModel('member');
// Check managed Email Host
if ($oMemberModel->isDeniedEmailHost($newEmail)) {
$config = $oMemberModel->getMemberConfig();
$emailhost_check = $config->emailhost_check;
$managed_email_host = lang('managed_email_host');
$email_hosts = $oMemberModel->getManagedEmailHosts();
foreach ($email_hosts as $host) {
$hosts[] = $host->email_host;
}
$message = sprintf($managed_email_host[$emailhost_check], implode(', ', $hosts), 'id@' . implode(', id@', $hosts));
return new Object(-1, $message);
}
// Check if the e-mail address is already registered
$member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail);
if ($member_srl) {
return new Object(-1, 'msg_exists_email_address');
}
if ($_SESSION['rechecked_password_step'] != 'INPUT_DATA') {
return $this->stop('msg_invalid_request');
}
unset($_SESSION['rechecked_password_step']);
$auth_args = new stdClass();
$auth_args->user_id = $newEmail;
$auth_args->member_srl = $member_info->member_srl;
$auth_args->auth_key = Rhymix\Framework\Security::getRandom(40, 'hex');
$auth_args->new_password = 'XE_change_emaill_address';
$oDB =& DB::getInstance();
$oDB->begin();
$output = executeQuery('member.insertAuthMail', $auth_args);
if (!$output->toBool()) {
$oDB->rollback();
return $output;
}
$oModuleModel = getModel('module');
$member_config = $oModuleModel->getModuleConfig('member');
$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
if (!is_dir($tpl_path)) {
$tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
}
global $lang;
$memberInfo = array();
$memberInfo[$lang->email_address] = $member_info->email_address;
$memberInfo[$lang->nick_name] = $member_info->nick_name;
Context::set('memberInfo', $memberInfo);
Context::set('newEmail', $newEmail);
$auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthEmailAddress', 'member_srl', $member_info->member_srl, 'auth_key', $auth_args->auth_key);
Context::set('auth_url', $auth_url);
$oTemplate =& TemplateHandler::getInstance();
$content = $oTemplate->compile($tpl_path, 'confirm_member_new_email');
$oMail = new Mail();
$oMail->setTitle(lang('title_modify_email_address'));
$oMail->setContent($content);
$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
$oMail->setReceiptor($member_info->nick_name, $newEmail);
$result = $oMail->send();
$msg = sprintf(lang('msg_confirm_mail_sent'), $newEmail);
$this->setMessage($msg);
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', '');
$this->setRedirectUrl($returnUrl);
}
示例8: procMobileexSendMessage
/**
* @brief 쪽지 발송
**/
function procMobileexSendMessage()
{
// 로그인 정보 체크
if (!Context::get('is_logged')) {
return new Object(-1, 'msg_not_logged');
}
$logged_info = Context::get('logged_info');
// 변수 검사
$receiver_srl = Context::get('receiver_srl');
$receiver_user_id = Context::get('receiver_user_id');
$oMemberModel =& getModel('member');
if ($receiver_user_id) {
if ($this->xe_ver > 4) {
$columnList = array('member_srl');
$receiver_info = $oMemberModel->getMemberInfoByUserID($receiver_user_id, $columnList);
} else {
$receiver_info = $oMemberModel->getMemberInfoByUserID($receiver_user_id);
}
}
if (!$receiver_srl) {
$receiver_srl = $receiver_info->member_srl;
}
// 마지막으로 받는이가 없으면..에러출력..
if (!$receiver_srl) {
return new Object(-1, 'msg_not_exists_member');
}
$title = trim(Context::get('title'));
if (!$title) {
return new Object(-1, 'msg_title_is_null');
}
$content = Context::get('content');
$content = str_replace("\r\n", "\n", $content);
$content = str_replace("\r", "\n", $content);
$content = trim($content);
if (!$content) {
return new Object(-1, 'msg_content_is_null');
}
$send_mail = Context::get('send_mail');
if ($send_mail != 'Y') {
$send_mail = 'N';
}
// 받을 회원이 있는지에 대한 검사
$oCommunicationModel =& getModel('communication');
$receiver_member_info = $oMemberModel->getMemberInfoByMemberSrl($receiver_srl);
if ($receiver_member_info->member_srl != $receiver_srl) {
return new Object(-1, 'msg_not_exists_member');
}
// 받을 회원의 쪽지 수신여부 검사 (최고관리자이면 패스)
if ($logged_info->is_admin != 'Y') {
if ($receiver_member_info->allow_message == 'F') {
if (!$oCommunicationModel->isFriend($receiver_member_info->member_srl)) {
return new object(-1, 'msg_allow_message_to_friend');
}
} elseif ($receiver_member_info->allow_messge == 'N') {
return new object(-1, 'msg_disallow_message');
}
}
$oCommunicationController =& getController('communication');
// 쪽지 발송
$output = $oCommunicationController->sendMessage($logged_info->member_srl, $receiver_srl, $title, $content);
// 메일로도 발송
if ($output->toBool() && $send_mail == 'Y') {
$view_url = Context::getRequestUri();
$content = sprintf("%s<br /><br />From : <a href=\"%s\" target=\"_blank\">%s</a>", $content, $view_url, $view_url);
$oMail = new Mail();
$oMail->setTitle($title);
$oMail->setContent($content);
$oMail->setSender($logged_info->user_name, $logged_info->email_address);
$oMail->setReceiptor($receiver_member_info->user_name, $receiver_member_info->email_address);
$oMail->send();
}
return $output;
}
示例9: procShopInsertComment
/**
* comment insert
**/
function procShopInsertComment() {
$oDocumentModel = &getModel('document');
$oCommentModel = &getModel('comment');
$oCommentController = &getController('comment');
if(!$this->grant->write_comment) return new Object(-1, 'msg_not_permitted');
$obj = Context::gets('document_srl','comment_srl','parent_srl','content','password','nick_name','member_srl','email_address','homepage','is_secret','notify_message');
$obj->module_srl = $this->module_srl;
$oDocument = $oDocumentModel->getDocument($obj->document_srl);
if(!$oDocument->isExists()) return new Object(-1,'msg_not_permitted');
if(!$obj->comment_srl) $obj->comment_srl = getNextSequence();
else $comment = $oCommentModel->getComment($obj->comment_srl, $this->grant->manager);
if($comment->comment_srl != $obj->comment_srl) {
if($obj->parent_srl) {
$parent_comment = $oCommentModel->getComment($obj->parent_srl);
if(!$parent_comment->comment_srl) return new Object(-1, 'msg_invalid_request');
$output = $oCommentController->insertComment($obj);
} else {
$output = $oCommentController->insertComment($obj);
}
if($output->toBool() && $this->module_info->admin_mail) {
$oMail = new Mail();
$oMail->setTitle($oDocument->getTitleText());
$oMail->setContent( sprintf("From : <a href=\"%s#comment_%d\">%s#comment_%d</a><br/>\r\n%s", $oDocument->getPermanentUrl(), $obj->comment_srl, $oDocument->getPermanentUrl(), $obj->comment_srl, $obj->content));
$oMail->setSender($obj->nick_name, $obj->email_address);
$target_mail = explode(',',$this->module_info->admin_mail);
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();
}
}
} else {
$obj->parent_srl = $comment->parent_srl;
$output = $oCommentController->updateComment($obj, $this->grant->manager);
$comment_srl = $obj->comment_srl;
}
if(!$output->toBool()) return $output;
$this->setRedirectUrl($_SERVER['HTTP_REFERER']);
}
示例10: sendEmail
/**
* 휴면 안내메일을 발송하는 메소드.
*/
public function sendEmail($member_srl, $config = null, $resend = true, $use_transaction = true)
{
// 회원 오브젝트를 통째로 받은 경우 member_srl을 추출한다.
if (is_object($member_srl) && isset($member_srl->member_srl)) {
$member = $member_srl;
$member_srl = $member_srl->member_srl;
} else {
$args = new stdClass();
$args->member_srl = $member_srl;
$member_query = executeQuery('member.getMemberInfoByMemberSrl', $args);
if (!$member_query->toBool() || !$member_query->data) {
return -41;
}
$member = is_object($member_query->data) ? $member_query->data : reset($member_query->data);
if (!$member) {
return -42;
}
$member_srl = $member->member_srl;
}
// 모듈 설정이 로딩되지 않은 경우 지금 로딩한다.
if (!$config) {
$config = $this->getConfig();
}
// 이미 발송한 경우, $resend = true가 아니라면 재발송하지 않는다.
$args = new stdClass();
$args->member_srl = $member_srl;
$output = executeQuery('member_expire.getNotifiedDates', $args);
if (!$output->toBool()) {
return -43;
}
if (count($output->data) && !$resend) {
return 2;
}
// 정리 예정일을 계산한다.
$start_date = strtotime($config->auto_start) + zgap();
$base_date = $member->last_login ? $member->last_login : $member->regdate;
$base_date = $base_date ? ztime($base_date) : 0;
$expire_date = $base_date + 86400 * $config->expire_threshold;
if ($expire_date < $start_date) {
$expire_date = $start_date;
}
$member->expire_date = date('YmdHis', $expire_date);
// 매크로를 변환한다.
$site_title = Context::getSiteTitle();
$macros = array('{SITE_NAME}' => htmlspecialchars($site_title, ENT_QUOTES, 'UTF-8', false), '{USER_ID}' => htmlspecialchars($member->user_id, ENT_QUOTES, 'UTF-8', false), '{USER_NAME}' => htmlspecialchars($member->user_name, ENT_QUOTES, 'UTF-8', false), '{NICK_NAME}' => htmlspecialchars($member->nick_name, ENT_QUOTES, 'UTF-8', false), '{EMAIL}' => htmlspecialchars($member->email_address, ENT_QUOTES, 'UTF-8', false), '{LOGIN_DATE}' => $base_date ? date('Y년 n월 j일', $base_date) : '(로그인 기록 없음)', '{EXPIRE_DATE}' => date('Y년 n월 j일', $expire_date), '{TIME_LIMIT}' => $this->translateThreshold($config->expire_threshold), '{CLEAN_METHOD}' => $config->expire_method === 'delete' ? '삭제' : '별도의 저장공간으로 이동');
// 메일을 작성하여 발송한다.
$subject = htmlspecialchars_decode(str_replace(array_keys($macros), array_values($macros), $config->email_subject));
$content = str_replace(array_keys($macros), array_values($macros), $config->email_content);
$recipient_name = $member->user_name ? $member->user_name : ($member->nick_name ? $member->nick_name : 'member');
static $sender_name = null;
static $sender_email = null;
if ($sender_name === null) {
$member_config = getModel('module')->getModuleConfig('member');
$sender_name = $member_config->webmaster_name ? $member_config->webmaster_name : ($site_title ? $site_title : 'webmaster');
$sender_email = $member_config->webmaster_email;
}
$oMail = new Mail();
$oMail->setTitle($subject);
$oMail->setContent($content);
$oMail->setSender($sender_name, $sender_email);
$oMail->setReceiptor($recipient_name, $member->email_address);
$oMail->send();
// 트랜잭션을 시작한다.
if ($use_transaction) {
$this->oDB->begin();
}
// 발송한 메일을 기록한다.
$output = executeQuery('member_expire.deleteNotifiedDate', $member);
if (!$output->toBool()) {
if ($use_transaction) {
$this->oDB->rollback();
}
return -44;
}
$output = executeQuery('member_expire.insertNotifiedDate', $member);
if (!$output->toBool()) {
if ($use_transaction) {
$this->oDB->rollback();
}
return -45;
}
// 트랜잭션을 커밋한다.
if ($use_transaction) {
$this->oDB->commit();
}
return 1;
}
示例11: sendEmailsToSubscribers
/**
* send email to subscribers
* @param Newsletter $newsletter
* @param $site_srl
*/
public function sendEmailsToSubscribers(Newsletter $newsletter, $site_srl)
{
$shopModel = getModel('shop');
$customerRepository = $shopModel->getCustomerRepository();
$output = $customerRepository->getNewsletterCustomers($site_srl, 'Y');
$emails_list = "";
foreach ($output->customers as $customer) {
//add unsubscribe link to $newsletter->content;
$newsletter_content = $newsletter->content . "</br></br>" . sprintf(Context::getLang('unsubscribe_message'), getUrl('', 'act', 'procShopUnsignToNewsletter', 'member_srl', $customer->member_srl, 'email_address', $customer->email_address));
$oMail = new Mail();
$oMail->setTitle($newsletter->subject);
$oMail->setContent($newsletter_content);
$oMail->setSender($newsletter->sender_name, $newsletter->sender_email);
$oMail->setReceiptor(false, $customer->email_address);
$oMail->send();
}
}
示例12: sendNewOrderMailToAdministrator
private static function sendNewOrderMailToAdministrator($shop, $order)
{
// Don't send anything if admin email is not configured
if (!$shop->getEmail()) {
ShopLogger::log("Failed to send order email to admin for order #{$order->order_srl}; Admin email is not configured");
return;
}
global $lang;
$admin_email_subject = sprintf($lang->admin_order_email_subject, $order->client_name, ShopDisplay::priceFormat($order->total, $shop->getCurrencySymbol()));
Context::set('email_order', $order);
$oTemplateHandler = TemplateHandler::getInstance();
$order_content = $oTemplateHandler->compile('./modules/shop/tpl', 'order_email.html');
$admin_email_content = sprintf($lang->admin_order_email_content, getFullSiteUrl('', 'act', 'dispShopToolViewOrder', 'order_srl', $order->order_srl), $order->order_srl, $order_content);
$oMail = new Mail();
$oMail->setTitle($admin_email_subject);
$oMail->setContent($admin_email_content);
$oMail->setSender($shop->getShopTitle(), $shop->getShopEmail());
$oMail->setReceiptor(false, $shop->getEmail());
$oMail->send();
}
示例13: procBoardInsertDocument
/**
* @brief insert document
**/
function procBoardInsertDocument()
{
// check grant
if ($this->module_info->module != "board") {
return new Object(-1, "msg_invalid_request");
}
if (!$this->grant->write_document) {
return new Object(-1, 'msg_not_permitted');
}
$logged_info = Context::get('logged_info');
// setup variables
$obj = Context::getRequestVars();
$obj->module_srl = $this->module_srl;
if ($obj->is_notice != 'Y' || !$this->grant->manager) {
$obj->is_notice = 'N';
}
$obj->commentStatus = $obj->comment_status;
settype($obj->title, "string");
if ($obj->title == '') {
$obj->title = cut_str(strip_tags($obj->content), 20, '...');
}
//setup dpcument title tp 'Untitled'
if ($obj->title == '') {
$obj->title = 'Untitled';
}
// unset document style if the user is not the document manager
if (!$this->grant->manager) {
unset($obj->title_color);
unset($obj->title_bold);
}
// generate document module model object
$oDocumentModel =& getModel('document');
// generate document module의 controller object
$oDocumentController =& getController('document');
// check if the document is existed
$oDocument = $oDocumentModel->getDocument($obj->document_srl, $this->grant->manager);
// if use anonymous is true
if ($this->module_info->use_anonymous == 'Y') {
$obj->notify_message = 'N';
$this->module_info->admin_mail = '';
$obj->member_srl = -1 * $logged_info->member_srl;
$obj->email_address = $obj->homepage = $obj->user_id = '';
$obj->user_name = $obj->nick_name = 'anonymous';
$bAnonymous = true;
$oDocument->add('member_srl', $obj->member_srl);
} else {
$bAnonymous = false;
}
// update the document if it is existed
if ($oDocument->isExists() && $oDocument->document_srl == $obj->document_srl) {
if (!$oDocument->isGranted()) {
return new Object(-1, 'msg_not_permitted');
}
if (!$this->grant->manager) {
// notice & document style same as before if not manager
$obj->is_notice = $oDocument->get('is_notice');
$obj->title_color = $oDocument->get('title_color');
$obj->title_bold = $oDocument->get('title_bold');
}
$output = $oDocumentController->updateDocument($oDocument, $obj);
$msg_code = 'success_updated';
// insert a new document otherwise
} else {
$output = $oDocumentController->insertDocument($obj, $bAnonymous);
$msg_code = 'success_registed';
$obj->document_srl = $output->get('document_srl');
// send an email to admin user
if ($output->toBool() && $this->module_info->admin_mail) {
$oMail = new Mail();
$oMail->setTitle($obj->title);
$oMail->setContent(sprintf("From : <a href=\"%s\">%s</a><br/>\r\n%s", getFullUrl('', 'document_srl', $obj->document_srl), getFullUrl('', 'document_srl', $obj->document_srl), $obj->content));
$oMail->setSender($obj->user_name, $obj->email_address);
$target_mail = explode(',', $this->module_info->admin_mail);
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();
}
}
}
// if there is an error
if (!$output->toBool()) {
return $output;
}
// return the results
$this->add('mid', Context::get('mid'));
$this->add('document_srl', $output->get('document_srl'));
// alert a message
$this->setMessage($msg_code);
}
示例14: procMemberModifyEmailAddress
function procMemberModifyEmailAddress()
{
if (!Context::get('is_logged')) {
return $this->stop('msg_not_logged');
}
$member_info = Context::get('logged_info');
$newEmail = Context::get('email_address');
if (!$newEmail) {
return $this->stop('msg_invalid_request');
}
$oMemberModel = getModel('member');
$member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail);
if ($member_srl) {
return new Object(-1, 'msg_exists_email_address');
}
if ($_SESSION['rechecked_password_step'] != 'INPUT_DATA') {
return $this->stop('msg_invalid_request');
}
unset($_SESSION['rechecked_password_step']);
$auth_args = new stdClass();
$auth_args->user_id = $newEmail;
$auth_args->member_srl = $member_info->member_srl;
$auth_args->auth_key = md5(rand(0, 999999));
$auth_args->new_password = 'XE_change_emaill_address';
$output = executeQuery('member.insertAuthMail', $auth_args);
if (!$output->toBool()) {
$oDB->rollback();
return $output;
}
$oModuleModel = getModel('module');
$member_config = $oModuleModel->getModuleConfig('member');
$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
if (!is_dir($tpl_path)) {
$tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
}
global $lang;
$memberInfo = array();
$memberInfo[$lang->email_address] = $member_info->email_address;
$memberInfo[$lang->nick_name] = $member_info->nick_name;
Context::set('memberInfo', $memberInfo);
Context::set('newEmail', $newEmail);
$auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthEmailAddress', 'member_srl', $member_info->member_srl, 'auth_key', $auth_args->auth_key);
Context::set('auth_url', $auth_url);
$oTemplate =& TemplateHandler::getInstance();
$content = $oTemplate->compile($tpl_path, 'confirm_member_new_email');
$oMail = new Mail();
$oMail->setTitle(Context::getLang('title_modify_email_address'));
$oMail->setContent($content);
$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
$oMail->setReceiptor($member_info->nick_name, $newEmail);
$result = $oMail->send();
$msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $newEmail);
$this->setMessage($msg);
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', '');
$this->setRedirectUrl($returnUrl);
}
示例15: procBoardInsertComment
/**
* @brief 코멘트 추가
**/
function procBoardInsertComment()
{
// 권한 체크
if (!$this->grant->write_comment) {
return new Object(-1, 'msg_not_permitted');
}
// 댓글 입력에 필요한 데이터 추출
$obj = Context::gets('document_srl', 'comment_srl', 'parent_srl', 'content', 'password', 'nick_name', 'nick_name', 'member_srl', 'email_address', 'homepage', 'is_secret', 'notify_message');
$obj->module_srl = $this->module_srl;
// 원글이 존재하는지 체크
$oDocumentModel =& getModel('document');
$oDocument = $oDocumentModel->getDocument($obj->document_srl);
if (!$oDocument->isExists()) {
return new Object(-1, 'msg_not_permitted');
}
// 익명 설정일 경우 여러가지 요소를 미리 제거 (알림용 정보들 제거)
if ($this->module_info->use_anonymous == 'Y') {
$obj->notify_message = 'N';
$this->module_info->admin_mail = '';
}
// comment 모듈의 model 객체 생성
$oCommentModel =& getModel('comment');
// comment 모듈의 controller 객체 생성
$oCommentController =& getController('comment');
// comment_srl이 존재하는지 체크
// 만일 comment_srl이 n/a라면 getNextSequence()로 값을 얻어온다.
if (!$obj->comment_srl) {
$obj->comment_srl = getNextSequence();
} else {
$comment = $oCommentModel->getComment($obj->comment_srl, $this->grant->manager);
}
// comment_srl이 없을 경우 신규 입력
if ($comment->comment_srl != $obj->comment_srl) {
// parent_srl이 있으면 답변으로
if ($obj->parent_srl) {
$parent_comment = $oCommentModel->getComment($obj->parent_srl);
if (!$parent_comment->comment_srl) {
return new Object(-1, 'msg_invalid_request');
}
$output = $oCommentController->insertComment($obj);
// 없으면 신규
} else {
$output = $oCommentController->insertComment($obj);
}
// 문제가 없고 모듈 설정에 관리자 메일이 등록되어 있으면 메일 발송
if ($output->toBool() && $this->module_info->admin_mail) {
$oMail = new Mail();
$oMail->setTitle($oDocument->getTitleText());
$oMail->setContent(sprintf("From : <a href=\"%s#comment_%d\">%s#comment_%d</a><br/>\r\n%s", $oDocument->getPermanentUrl(), $obj->comment_srl, $oDocument->getPermanentUrl(), $obj->comment_srl, $obj->content));
$oMail->setSender($obj->user_name, $obj->email_address);
$target_mail = explode(',', $this->module_info->admin_mail);
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();
}
}
// comment_srl이 있으면 수정으로
} else {
$obj->parent_srl = $comment->parent_srl;
$output = $oCommentController->updateComment($obj, $this->grant->manager);
$comment_srl = $obj->comment_srl;
}
if (!$output->toBool()) {
return $output;
}
// 익명 사용시 글의 글쓴이 정보를 모두 제거
if ($this->module_info->use_anonymous == 'Y' && Context::get('is_logged')) {
$logged_info = Context::get('logged_info');
$comment = $oCommentModel->getComment($output->get('comment_srl'), $this->grant->manager);
$obj = $comment->getObjectVars();
$obj->member_srl = -1 * $logged_info->member_srl;
$obj->email_address = $obj->homepage = $obj->user_id = '';
$obj->user_name = $obj->nick_name = 'anonymous';
$output = executeQuery('comment.updateComment', $obj);
if (!$output->toBool()) {
return $output;
}
}
$this->setMessage('success_registed');
$this->add('mid', Context::get('mid'));
$this->add('document_srl', $obj->document_srl);
$this->add('comment_srl', $obj->comment_srl);
}