本文整理匯總了PHP中InboundEmail::importMessages方法的典型用法代碼示例。如果您正苦於以下問題:PHP InboundEmail::importMessages方法的具體用法?PHP InboundEmail::importMessages怎麽用?PHP InboundEmail::importMessages使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類InboundEmail
的用法示例。
在下文中一共展示了InboundEmail::importMessages方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: InboundEmail
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
********************************************************************************/
global $current_user;
if (isset($_REQUEST['type']) && $_REQUEST['type'] == 'personal') {
if ($current_user->hasPersonalEmail()) {
$ie = new InboundEmail();
$beans = $ie->retrieveByGroupId($current_user->id);
if (!empty($beans)) {
/** @var InboundEmail $bean */
foreach ($beans as $bean) {
$bean->importMessages();
}
}
}
header('Location: index.php?module=Emails&action=ListView&type=inbound&assigned_user_id=' . $current_user->id);
} elseif (isset($_REQUEST['type']) && $_REQUEST['type'] == 'group') {
$ie = new InboundEmail();
// this query only polls Group Inboxes
$r = $ie->db->query('SELECT inbound_email.id FROM inbound_email JOIN users ON inbound_email.group_id = users.id WHERE inbound_email.deleted=0 AND inbound_email.status = \'Active\' AND mailbox_type != \'bounce\' AND users.deleted = 0 AND users.is_group = 1');
while ($a = $ie->db->fetchByAssoc($r)) {
$ieX = new InboundEmail();
$ieX->retrieve($a['id']);
$ieX->importMessages();
}
header('Location: index.php?module=Emails&action=ListViewGroup');
} else {
// fail gracefully
header('Location: index.php?module=Emails&action=index');
}
示例2: pollMonitoredInboxesForBouncedCampaignEmails
function pollMonitoredInboxesForBouncedCampaignEmails()
{
Log::info('----->Scheduler job of type pollMonitoredInboxesForBouncedCampaignEmails()');
global $dictionary;
$ie = new InboundEmail();
$r = $ie->db->query('SELECT id FROM inbound_email WHERE deleted=0 AND status=\'Active\' AND mailbox_type=\'bounce\'');
while ($a = $ie->db->fetchByAssoc($r)) {
$ieX = new InboundEmail();
$ieX->retrieve($a['id']);
$ieX->connectMailserver();
$ieX->importMessages();
}
return true;
}
示例3: testimportMessages
public function testimportMessages()
{
$inboundEmail = new InboundEmail();
//execute the method and test if it works and does not throws an exception.
try {
$inboundEmail->protocol = 'pop3';
$inboundEmail->importMessages();
$this->assertTrue(true);
} catch (Exception $e) {
$this->fail();
}
}