本文整理匯總了PHP中InboundEmail::findOptimumSettings方法的典型用法代碼示例。如果您正苦於以下問題:PHP InboundEmail::findOptimumSettings方法的具體用法?PHP InboundEmail::findOptimumSettings怎麽用?PHP InboundEmail::findOptimumSettings使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類InboundEmail
的用法示例。
在下文中一共展示了InboundEmail::findOptimumSettings方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: array
function _createInboundAccount()
{
global $inbound_account_id, $current_user;
$stored_options = array();
$stored_options['from_name'] = "UnitTest";
$stored_options['from_addr'] = "ajaysales@sugarcrm.com";
$stored_options['reply_to_name'] = "UnitTest";
$stored_options['reply_to_addr'] = "ajaysales@sugarcrm.com";
$stored_options['only_since'] = false;
$stored_options['filter_domain'] = "";
$stored_options['trashFolder'] = "INBOX.Trash";
$stored_options['leaveMessagesOnMailServer'] = 1;
$useSsl = false;
$focus = new InboundEmail();
$focus->name = "Ajay Sales Personal Unittest";
$focus->email_user = "ajaysales@sugarcrm.com";
$focus->email_password = "f00f004";
$focus->server_url = "mail.sugarcrm.com";
$focus->protocol = "imap";
$focus->mailbox = "INBOX";
$focus->port = "143";
$optimum = $focus->findOptimumSettings($useSsl);
$focus->service = $optimum['serial'];
$focus->is_personal = 1;
$focus->status = "Active";
$focus->mailbox_type = 'pick';
$focus->group_id = $current_user->id;
$teamId = User::getPrivateTeam($current_user->id);
$focus->team_id = $teamId;
$focus->team_set_id = $focus->getTeamSetIdForTeams($teamId);
$focus->stored_options = base64_encode(serialize($stored_options));
$inbound_account_id = $focus->save();
}
示例2: isset
$focus->email_password = $_REQUEST['email_password'];
}
$focus->protocol = $_REQUEST['protocol'];
if (isset($_REQUEST['is_create_case']) && $_REQUEST['is_create_case'] == 'on') {
$focus->mailbox_type = 'createcase';
} else {
if (empty($focus->mailbox_type) || $focus->mailbox_type == 'createcase') {
$focus->mailbox_type = 'pick';
}
}
/////////////////////////////////////////////////////////
//// SERVICE STRING CONCATENATION
$useSsl = isset($_REQUEST['ssl']) && $_REQUEST['ssl'] == 1 ? true : false;
$optimum = $focus->getSessionConnectionString($focus->server_url, $focus->email_user, $focus->port, $focus->protocol);
if (empty($optimum)) {
$optimum = $focus->findOptimumSettings($useSsl, $focus->email_user, $focus->email_password, $focus->server_url, $focus->port, $focus->protocol, $focus->mailbox);
}
// if
$delimiter = $focus->getSessionInboundDelimiterString($focus->server_url, $focus->email_user, $focus->port, $focus->protocol);
//added check to ensure the $optimum['serial']) is not empty.
if (is_array($optimum) && count($optimum) > 0 && !empty($optimum['serial'])) {
$focus->service = $optimum['serial'];
} else {
// no save
// allowing bad save to allow Email Campaigns configuration to continue even without IMAP
$focus->service = "::::::" . $focus->protocol . "::::";
// save bogus info.
$error = "&error=true";
}
//// END SERVICE STRING CONCAT
/////////////////////////////////////////////////////////
示例3: testfindOptimumSettings
public function testfindOptimumSettings()
{
$inboundEmail = new InboundEmail();
//test with different parameters, it will always return false because we do not have a mail server to connect.
$this->assertEquals(false, $inboundEmail->findOptimumSettings());
$this->assertEquals(false, $inboundEmail->findOptimumSettings(true));
$this->assertEquals(false, $inboundEmail->findOptimumSettings(false, 'test', 'test', '', '', 'INBOX'));
}