本文整理汇总了PHP中SugarEmailAddress::getAddressesByGUID方法的典型用法代码示例。如果您正苦于以下问题:PHP SugarEmailAddress::getAddressesByGUID方法的具体用法?PHP SugarEmailAddress::getAddressesByGUID怎么用?PHP SugarEmailAddress::getAddressesByGUID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SugarEmailAddress
的用法示例。
在下文中一共展示了SugarEmailAddress::getAddressesByGUID方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: displayComposeEmail
/**
* Returns the templatized compose screen. Used by reply, forwards and draft status messages.
* @param object email Email bean in focus
*/
function displayComposeEmail($email)
{
global $locale;
global $current_user;
$ea = new SugarEmailAddress();
if (!empty($email)) {
$email->cids2Links();
$description = empty($email->description_html) ? $email->description : $email->description_html;
}
//Get the most complete address list availible for this email
$addresses = array('toAddresses' => 'to', 'ccAddresses' => 'cc', 'bccAddresses' => 'bcc');
foreach ($addresses as $var => $type) {
${$var} = "";
foreach (array("{$type}_addrs_names", "{$type}addrs", "{$type}_addrs") as $emailVar) {
if (!empty($email->{$emailVar})) {
${$var} = $email->{$emailVar};
break;
}
}
}
$ret = array();
$ret['type'] = $email->type;
$ret['name'] = $email->name;
$ret['description'] = $description;
$ret['from'] = isset($_REQUEST['composeType']) && $_REQUEST['composeType'] == 'forward' ? "" : $email->from_addr;
$ret['to'] = from_html($toAddresses);
$ret['uid'] = $email->id;
$ret['parent_name'] = $email->parent_name;
$ret['parent_type'] = $email->parent_type;
$ret['parent_id'] = $email->parent_id;
if ($email->type == 'draft') {
$ret['cc'] = from_html($ccAddresses);
$ret['bcc'] = $bccAddresses;
}
// reply all
if (isset($_REQUEST['composeType']) && $_REQUEST['composeType'] == 'replyAll') {
$ret['cc'] = from_html($ccAddresses);
$ret['bcc'] = $bccAddresses;
$userEmails = array();
$userEmailsMeta = $ea->getAddressesByGUID($current_user->id, 'Users');
foreach ($userEmailsMeta as $emailMeta) {
$userEmails[] = from_html(strtolower(trim($emailMeta['email_address'])));
}
$userEmails[] = from_html(strtolower(trim($email->from_addr)));
$ret['cc'] = from_html($email->cc_addrs);
$toAddresses = from_html($toAddresses);
$to = str_replace($this->addressSeparators, "::", $toAddresses);
$exTo = explode("::", $to);
if (is_array($exTo)) {
foreach ($exTo as $addr) {
$addr = strtolower(trim($addr));
if (!in_array($addr, $userEmails)) {
if (!empty($ret['cc'])) {
$ret['cc'] = $ret['cc'] . ", ";
}
$ret['cc'] = $ret['cc'] . trim($addr);
}
}
} elseif (!empty($exTo)) {
$exTo = trim($exTo);
if (!in_array($exTo, $userEmails)) {
$ret['cc'] = $ret['cc'] . ", " . $exTo;
}
}
}
return $ret;
}
示例2: array
}
$duplicateRealtyTemplates = array();
$db = DBManagerFactory::getInstance();
$result = $db->query($query);
$i = 0;
$sea = new SugarEmailAddress();
while (($row = $db->fetchByAssoc($result)) != null) {
foreach ($row as $key => $value) {
if ($value == $_POST['RealtyTemplates' . $key] && !empty($value)) {
$duplicateRealtyTemplates[$i][$key] = '<span style="color: red;">' . $value . '</span>';
} else {
$duplicateRealtyTemplates[$i][$key] = $value;
}
}
//$duplicateRealtyTemplates[$i] = $row;
$emails = $sea->getAddressesByGUID($row['id'], 'RealtyTemplates');
$duplicateRealtyTemplates[$i]['email'] = '';
foreach ($emails as $email) {
if (in_array($email['email_address'], $_POST)) {
$duplicateRealtyTemplates[$i]['email'] .= '<span style="color: red;">' . $email['email_address'] . '</span><br>';
} else {
$duplicateRealtyTemplates[$i]['email'] .= $email['email_address'] . '<br>';
}
}
$i++;
}
$xtpl->assign('FORMBODY', $realtytemplatesForm->buildTableForm($duplicateRealtyTemplates));
$input = '';
foreach ($realtytemplates->column_fields as $field) {
if (!empty($_POST['RealtyTemplates' . $field])) {
$input .= "<input type='hidden' name='{$field}' value='{$_POST['RealtyTemplates' . $field]}'>\n";
示例3: displayComposeEmail
/**
* Returns the templatized compose screen. Used by reply, forwards and draft status messages.
* @param object email Email bean in focus
*/
function displayComposeEmail($email)
{
global $locale;
global $current_user;
$ea = new SugarEmailAddress();
if (!empty($email)) {
$description = empty($email->description_html) ? $email->description : from_html($email->description_html);
}
$toaddresses = from_html(isset($email->toaddrs) ? $email->toaddrs : $email->to_addrs);
$ccAddresses = from_html(isset($email->ccAddrs) ? $email->ccAddrs : $email->cc_addrs);
$bccAddresses = from_html(isset($email->bccAddrs) ? $email->bccAddrs : $email->bcc_addrs);
$ret = array();
$ret['type'] = $email->type;
$ret['name'] = $email->name;
$ret['description'] = $description;
$ret['from'] = isset($_REQUEST['composeType']) && $_REQUEST['composeType'] == 'forward' ? "" : $email->from_addr;
$ret['to'] = $toaddresses;
$ret['cc'] = $ccAddresses;
$ret['bcc'] = $bccAddresses;
$ret['uid'] = $email->id;
$ret['parent_name'] = $email->parent_name;
$ret['parent_type'] = $email->parent_type;
$ret['parent_id'] = $email->parent_id;
// reply all
if (isset($_REQUEST['composeType']) && $_REQUEST['composeType'] == 'replyAll') {
$userEmails = array();
$userEmailsMeta = $ea->getAddressesByGUID($current_user->id, 'Users');
foreach ($userEmailsMeta as $emailMeta) {
$userEmails[] = from_html(strtolower(trim($emailMeta['email_address'])));
}
$userEmails[] = from_html(strtolower(trim($email->from_addr)));
$ret['cc'] = from_html($email->cc_addrs);
$to = str_replace($this->addressSeparators, "::", $toaddresses);
$exTo = explode("::", $to);
if (is_array($exTo)) {
foreach ($exTo as $addr) {
$addr = strtolower(trim($addr));
if (!in_array($addr, $userEmails)) {
if (!empty($ret['cc'])) {
$ret['cc'] = $ret['cc'] . ", ";
}
$ret['cc'] = $ret['cc'] . trim($addr);
}
}
} elseif (!empty($exTo)) {
$exTo = trim($exTo);
if (!in_array($exTo, $userEmails)) {
$ret['cc'] = $ret['cc'] . ", " . $exTo;
}
}
}
return $ret;
}