本文整理汇总了PHP中OutboundEmail::retrieve方法的典型用法代码示例。如果您正苦于以下问题:PHP OutboundEmail::retrieve方法的具体用法?PHP OutboundEmail::retrieve怎么用?PHP OutboundEmail::retrieve使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OutboundEmail
的用法示例。
在下文中一共展示了OutboundEmail::retrieve方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getUsersMailerForSystemOverride
/**
* Retrieves the mailer for a user if they have overriden the username
* and password for the default system account.
*
* @param String $user_id
*/
function getUsersMailerForSystemOverride($user_id)
{
$query = "SELECT id FROM outbound_email WHERE user_id = '{$user_id}' AND type = 'system-override' ORDER BY name";
$rs = $this->db->query($query);
$row = $this->db->fetchByAssoc($rs);
if (!empty($row['id'])) {
$oe = new OutboundEmail();
$oe->retrieve($row['id']);
return $oe;
} else {
return null;
}
}
示例2: isset
$ie->{$k} = $retService;
}
if (isset($ie->{$k})) {
$ret[$k] = $ie->{$k};
}
}
$out = $json->encode($ret);
echo $out;
}
//If the user is saving the username/password then we need to update the outbound account.
$outboundMailUser = isset($_REQUEST['mail_smtpuser']) ? $_REQUEST['mail_smtpuser'] : "";
$outboundMailPass = isset($_REQUEST['mail_smtppass']) ? $_REQUEST['mail_smtppass'] : "";
$outboundMailId = isset($_REQUEST['outbound_email']) ? $_REQUEST['outbound_email'] : "";
if (!empty($outboundMailUser) && !empty($outboundMailPass) && !empty($outboundMailId)) {
$oe = new OutboundEmail();
$oe->retrieve($outboundMailId);
$oe->mail_smtpuser = $outboundMailUser;
$oe->mail_smtppass = $outboundMailPass;
$oe->save();
}
} else {
echo "NOOP";
}
break;
case "getIeAccount":
$GLOBALS['log']->debug("********** EMAIL 2.0 - Asynchronous - at: getIeAccount");
$ie->retrieve($_REQUEST['ieId']);
if ($ie->group_id == $current_user->id) {
$ret = array();
foreach ($ie->field_defs as $k => $v) {
if ($k == 'stored_options') {
示例3: OutboundEmail
function testSystemAccountMailSettingsChangedNoUserAccessToUsername()
{
//User not alloweed to access system email username/password
$GLOBALS['db']->query("DELETE FROM config WHERE category='notify' AND name='allow_default_outbound' ");
$newSystemPort = 864;
$newSystemServer = "system.imap.com";
$userID = create_guid();
$ob = new OutboundEmail();
$ob->id = $userID;
$ob->new_with_id = TRUE;
$ob->name = 'Sugar Test 2';
$ob->type = 'system-override';
$ob->user_id = $this->_user->id;
$ob->mail_sendtype = "SMTP";
$ob->mail_smtpuser = "Test User";
$ob->mail_smtppass = "User Pass";
$ob->save();
$this->ob = $ob;
$system = $ob->getSystemMailerSettings();
$system->new_with_id = FALSE;
$system->mail_smtpport = $newSystemPort;
$system->mail_smtpserver = $newSystemServer;
$system->saveSystem();
$obRetrieved = new OutboundEmail();
$obRetrieved->retrieve($userID);
$this->assertEquals($newSystemPort, $obRetrieved->mail_smtpport, "Could not update users system-override accounts after system save.");
$this->assertEquals($newSystemServer, $obRetrieved->mail_smtpserver, "Could not update users system-override accounts after system save.");
$this->assertEquals("Test User", $obRetrieved->mail_smtpuser, "Could not update users system-override accounts after system save.");
$this->assertEquals("User Pass", $obRetrieved->mail_smtppass, "Could not update users system-override accounts after system save.");
}
示例4: array
$ret = array();
foreach ($oe->field_defs as $def) {
$ret[$def] = $oe->{$def};
}
$out = $json->encode($ret, true);
echo $out;
} else {
echo "NOOP";
}
break;
case "deleteOutbound":
$GLOBALS['log']->debug("********** EMAIL 2.0 - Asynchronous - at: deleteOutbound");
if (isset($_REQUEST['outbound_email']) && !empty($_REQUEST['outbound_email'])) {
$oe = new OutboundEmail();
global $current_user;
$oe->retrieve($_REQUEST['outbound_email']);
$oe->delete();
$ret = array();
$count = 0;
$outbounds = $oe->getUserMailers($current_user);
$out = $json->encode($outbounds, true);
echo $out;
} else {
echo "NOOP";
}
break;
case "saveOutbound":
$GLOBALS['log']->debug("********** EMAIL 2.0 - Asynchronous - at: saveOutbound");
$oe = new OutboundEmail();
$oe->id = $_REQUEST['mail_id'];
$oe->name = $_REQUEST['mail_name'];