本文整理匯總了PHP中InboundEmail::mark_answered方法的典型用法代碼示例。如果您正苦於以下問題:PHP InboundEmail::mark_answered方法的具體用法?PHP InboundEmail::mark_answered怎麽用?PHP InboundEmail::mark_answered使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類InboundEmail
的用法示例。
在下文中一共展示了InboundEmail::mark_answered方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: SugarPHPMailer
//.........這裏部分代碼省略.........
$this->status = 'draft';
$forceSave = true;
}
/**********************************************************************
* SEND EMAIL (finally!)
*/
$mailSent = false;
if ($this->type != 'draft') {
$mail->prepForOutbound();
$mail->Body = $this->decodeDuringSend($mail->Body);
$mail->AltBody = $this->decodeDuringSend($mail->AltBody);
if (!$mail->Send()) {
$this->status = 'send_error';
ob_clean();
echo $app_strings['LBL_EMAIL_ERROR_PREPEND'] . $mail->ErrorInfo;
return false;
}
}
if (!(empty($orignialId) || isset($request['saveDraft']) || $this->type == 'draft' && $this->status == 'draft') && ($_REQUEST['composeType'] == 'reply' || $_REQUEST['composeType'] == 'replyAll' || $_REQUEST['composeType'] == 'replyCase') && $orignialId != $this->id) {
$originalEmail = new Email();
$originalEmail->retrieve($orignialId);
$originalEmail->reply_to_status = 1;
$originalEmail->save();
$this->reply_to_status = 0;
}
// if
if ($_REQUEST['composeType'] == 'reply' || $_REQUEST['composeType'] == 'replyCase') {
if (isset($_REQUEST['ieId']) && isset($_REQUEST['mbox'])) {
$emailFromIe = new InboundEmail();
$emailFromIe->retrieve($_REQUEST['ieId']);
$emailFromIe->mailbox = $_REQUEST['mbox'];
if (isset($emailFromIe->id) && $emailFromIe->is_personal) {
if ($emailFromIe->isPop3Protocol()) {
$emailFromIe->mark_answered($this->uid, 'pop3');
} elseif ($emailFromIe->connectMailserver() == 'true') {
$emailFromIe->markEmails($this->uid, 'answered');
$emailFromIe->mark_answered($this->uid);
}
}
}
}
if ($forceSave || $this->type == 'draft' || isset($request['saveToSugar']) && $request['saveToSugar'] == 1) {
// saving a draft OR saving a sent email
$decodedFromName = mb_decode_mimeheader($mail->FromName);
$this->from_addr = "{$decodedFromName} <{$mail->From}>";
$this->from_addr_name = $this->from_addr;
$this->to_addrs = $_REQUEST['sendTo'];
$this->to_addrs_names = $_REQUEST['sendTo'];
$this->cc_addrs = $_REQUEST['sendCc'];
$this->cc_addrs_names = $_REQUEST['sendCc'];
$this->bcc_addrs = $_REQUEST['sendBcc'];
$this->bcc_addrs_names = $_REQUEST['sendBcc'];
$this->assigned_user_id = $current_user->id;
$this->date_sent = $timedate->now();
///////////////////////////////////////////////////////////////////
//// LINK EMAIL TO SUGARBEANS BASED ON EMAIL ADDY
if (isset($_REQUEST['parent_type']) && !empty($_REQUEST['parent_type']) && isset($_REQUEST['parent_id']) && !empty($_REQUEST['parent_id'])) {
$this->parent_id = $_REQUEST['parent_id'];
$this->parent_type = $_REQUEST['parent_type'];
$q = "SELECT count(*) c FROM emails_beans WHERE email_id = '{$this->id}' AND bean_id = '{$_REQUEST['parent_id']}' AND bean_module = '{$_REQUEST['parent_type']}'";
$r = $this->db->query($q);
$a = $this->db->fetchByAssoc($r);
if ($a['c'] <= 0) {
if (isset($beanList[$_REQUEST['parent_type']]) && !empty($beanList[$_REQUEST['parent_type']])) {
$className = $beanList[$_REQUEST['parent_type']];
if (isset($beanFiles[$className]) && !empty($beanFiles[$className])) {
示例2: testmark_answered
public function testmark_answered()
{
$inboundEmail = new InboundEmail();
$inboundEmail->id = 1;
//execute the method to populate answered field
$inboundEmail->mark_answered(1, 'pop3');
//retrieve back to verify the records updated
$result = $inboundEmail->getCacheValue('INBOX');
$this->assertEquals(1, $result['retArr'][0]->answered);
}