当前位置: 首页>>代码示例>>PHP>>正文


PHP Support::removeEmail方法代码示例

本文整理汇总了PHP中Support::removeEmail方法的典型用法代码示例。如果您正苦于以下问题:PHP Support::removeEmail方法的具体用法?PHP Support::removeEmail怎么用?PHP Support::removeEmail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Support的用法示例。


在下文中一共展示了Support::removeEmail方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: foreach

        $tpl->assign('associate_result', $res);
    } else {
        foreach ($_POST['item'] as $item) {
            $email = Support::getEmailDetails(Email_Account::getAccountByEmail($item), $item);
            // add the message body as a note
            $_POST['full_message'] = $email['seb_full_email'];
            $_POST['title'] = $email['sup_subject'];
            $_POST['note'] = $email['seb_body'];
            // XXX: probably broken to use the current logged in user as the 'owner' of
            // XXX: this new note, but that's how it was already
            $res = Note::insertFromPost(Auth::getUserID(), $_POST['issue_id'], false, true, false, true, true);
            // remove the associated email
            if ($res) {
                list($_POST['from']) = Support::getSender(array($item));
                Workflow::handleBlockedEmail(Issue::getProjectID($_POST['issue_id']), $_POST['issue_id'], $_POST, 'associated');
                Support::removeEmail($item);
            }
        }
        $tpl->assign('associate_result', $res);
    }
    @$tpl->assign('total_emails', count($_POST['item']));
} else {
    @$tpl->assign('emails', $_GET['item']);
    @$tpl->assign('total_emails', count($_GET['item']));
    $prj_id = Issue::getProjectID($_GET['issue_id']);
    if (CRM::hasCustomerIntegration($prj_id)) {
        // check if the selected emails all have sender email addresses that are associated with the issue' customer
        $crm = CRM::getInstance($prj_id);
        $senders = Support::getSender($_GET['item']);
        $sender_emails = array();
        foreach ($senders as $sender) {
开发者ID:korusdipl,项目名称:eventum,代码行数:31,代码来源:associate.php

示例2: list

        $tpl->assign("associate_result", $res);
    } else {
        for ($i = 0; $i < count($HTTP_POST_VARS['item']); $i++) {
            $email = Support::getEmailDetails(Email_Account::getAccountByEmail($HTTP_POST_VARS['item'][$i]), $HTTP_POST_VARS['item'][$i]);
            // add the message body as a note
            $HTTP_POST_VARS['blocked_msg'] = $email['seb_full_email'];
            $HTTP_POST_VARS['title'] = $email['sup_subject'];
            $HTTP_POST_VARS['note'] = $email['seb_body'];
            // XXX: probably broken to use the current logged in user as the 'owner' of
            // XXX: this new note, but that's how it was already
            $res = Note::insert(Auth::getUserID(), $HTTP_POST_VARS['issue']);
            // remove the associated email
            if ($res) {
                list($HTTP_POST_VARS["from"]) = Support::getSender(array($HTTP_POST_VARS['item'][$i]));
                Workflow::handleBlockedEmail(Issue::getProjectID($HTTP_POST_VARS['issue']), $HTTP_POST_VARS['issue'], $HTTP_POST_VARS, 'associated');
                Support::removeEmail($HTTP_POST_VARS['item'][$i]);
            }
        }
        $tpl->assign("associate_result", $res);
    }
    @$tpl->assign('total_emails', count($HTTP_POST_VARS['item']));
} else {
    @$tpl->assign('emails', $HTTP_GET_VARS['item']);
    @$tpl->assign('total_emails', count($HTTP_GET_VARS['item']));
    $prj_id = Issue::getProjectID($HTTP_GET_VARS['issue']);
    if (Customer::hasCustomerIntegration($prj_id)) {
        // check if the selected emails all have sender email addresses that are associated with the issue' customer
        $senders = Support::getSender($HTTP_GET_VARS['item']);
        $sender_emails = array();
        for ($i = 0; $i < count($senders); $i++) {
            $email = Mail_API::getEmailAddress($senders[$i]);
开发者ID:juliogallardo1326,项目名称:proc,代码行数:31,代码来源:associate.php

示例3: expungeEmails

 /**
  * Permanently removes the given support emails from the associated email
  * server.
  *
  * @access  public
  * @param   array $sup_ids The list of support emails
  * @return  integer 1 if the removal worked, -1 otherwise
  */
 function expungeEmails($sup_ids)
 {
     $accounts = array();
     $stmt = "SELECT\n                    sup_id,\n                    sup_message_id,\n                    sup_ema_id\n                 FROM\n                    " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "support_email\n                 WHERE\n                    sup_id IN (" . implode(', ', Misc::escapeInteger($sup_ids)) . ")";
     $res = $GLOBALS["db_api"]->dbh->getAll($stmt, DB_FETCHMODE_ASSOC);
     if (PEAR::isError($res)) {
         Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
         return -1;
     } else {
         for ($i = 0; $i < count($res); $i++) {
             // don't remove emails from the imap/pop3 server if the email
             // account is set to leave a copy of the messages on the server
             $account_details = Email_Account::getDetails($res[$i]['sup_ema_id']);
             if (!$account_details['leave_copy']) {
                 // try to re-use an open connection to the imap server
                 if (!in_array($res[$i]['sup_ema_id'], array_keys($accounts))) {
                     $accounts[$res[$i]['sup_ema_id']] = Support::connectEmailServer(Email_Account::getDetails($res[$i]['sup_ema_id']));
                 }
                 $mbox = $accounts[$res[$i]['sup_ema_id']];
                 if ($mbox !== FALSE) {
                     // now try to find the UID of the current message-id
                     $matches = @imap_search($mbox, 'TEXT "' . $res[$i]['sup_message_id'] . '"');
                     if (count($matches) > 0) {
                         for ($y = 0; $y < count($matches); $y++) {
                             $headers = imap_headerinfo($mbox, $matches[$y]);
                             // if the current message also matches the message-id header, then remove it!
                             if ($headers->message_id == $res[$i]['sup_message_id']) {
                                 @imap_delete($mbox, $matches[$y]);
                                 @imap_expunge($mbox);
                                 break;
                             }
                         }
                     }
                 }
             }
             // remove the email record from the table
             Support::removeEmail($res[$i]['sup_id']);
         }
         return 1;
     }
 }
开发者ID:juliogallardo1326,项目名称:proc,代码行数:49,代码来源:class.support.php


注:本文中的Support::removeEmail方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。