当前位置: 首页>>代码示例>>PHP>>正文


PHP Support::getSender方法代码示例

本文整理汇总了PHP中Support::getSender方法的典型用法代码示例。如果您正苦于以下问题:PHP Support::getSender方法的具体用法?PHP Support::getSender怎么用?PHP Support::getSender使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Support的用法示例。


在下文中一共展示了Support::getSender方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: list

            if ($res) {
                list($HTTP_POST_VARS["from"]) = Support::getSender(array($HTTP_POST_VARS['item'][$i]));
                Workflow::handleBlockedEmail(Issue::getProjectID($HTTP_POST_VARS['issue']), $HTTP_POST_VARS['issue'], $HTTP_POST_VARS, 'associated');
                Support::removeEmail($HTTP_POST_VARS['item'][$i]);
            }
        }
        $tpl->assign("associate_result", $res);
    }
    @$tpl->assign('total_emails', count($HTTP_POST_VARS['item']));
} else {
    @$tpl->assign('emails', $HTTP_GET_VARS['item']);
    @$tpl->assign('total_emails', count($HTTP_GET_VARS['item']));
    $prj_id = Issue::getProjectID($HTTP_GET_VARS['issue']);
    if (Customer::hasCustomerIntegration($prj_id)) {
        // check if the selected emails all have sender email addresses that are associated with the issue' customer
        $senders = Support::getSender($HTTP_GET_VARS['item']);
        $sender_emails = array();
        for ($i = 0; $i < count($senders); $i++) {
            $email = Mail_API::getEmailAddress($senders[$i]);
            $sender_emails[$email] = $senders[$i];
        }
        $customer_id = Issue::getCustomerID($HTTP_GET_VARS['issue']);
        if (!empty($customer_id)) {
            $contact_emails = array_keys(Customer::getContactEmailAssocList($prj_id, $customer_id));
            $unknown_contacts = array();
            foreach ($sender_emails as $email => $address) {
                if (!@in_array($email, $contact_emails)) {
                    $usr_id = User::getUserIDByEmail($email);
                    if (empty($usr_id)) {
                        $unknown_contacts[] = $address;
                    } else {
开发者ID:juliogallardo1326,项目名称:proc,代码行数:31,代码来源:associate.php

示例2: list

                list($_POST['from']) = Support::getSender(array($item));
                Workflow::handleBlockedEmail(Issue::getProjectID($_POST['issue_id']), $_POST['issue_id'], $_POST, 'associated');
                Support::removeEmail($item);
            }
        }
        $tpl->assign('associate_result', $res);
    }
    @$tpl->assign('total_emails', count($_POST['item']));
} else {
    @$tpl->assign('emails', $_GET['item']);
    @$tpl->assign('total_emails', count($_GET['item']));
    $prj_id = Issue::getProjectID($_GET['issue_id']);
    if (CRM::hasCustomerIntegration($prj_id)) {
        // check if the selected emails all have sender email addresses that are associated with the issue' customer
        $crm = CRM::getInstance($prj_id);
        $senders = Support::getSender($_GET['item']);
        $sender_emails = array();
        foreach ($senders as $sender) {
            $email = Mail_Helper::getEmailAddress($sender);
            $sender_emails[$email] = $sender;
        }
        $contract_id = Issue::getContractID($_GET['issue_id']);
        if (!empty($contract_id)) {
            try {
                $contract = $crm->getContract($contract_id);
                // TODOCRM: Active contacts only
                $contact_emails = array_keys($contract->getContactEmailAssocList());
            } catch (CRMException $e) {
                $contact_emails = array();
            }
            $unknown_contacts = array();
开发者ID:korusdipl,项目名称:eventum,代码行数:31,代码来源:associate.php

示例3: notifyEmailConvertedIntoIssue

 /**
  * Method used to send an email notification to the sender of a
  * set of email messages that were manually converted into an
  * issue.
  *
  * @param   integer $prj_id The project ID
  * @param   integer $issue_id The issue ID
  * @param   array $sup_ids The email IDs
  * @param bool|int $customer_id The customer ID
  * @return  array The list of recipient emails
  */
 public static function notifyEmailConvertedIntoIssue($prj_id, $issue_id, $sup_ids, $customer_id = false)
 {
     if (CRM::hasCustomerIntegration($prj_id)) {
         $crm = CRM::getInstance($prj_id);
         return $crm->notifyEmailConvertedIntoIssue($issue_id, $sup_ids, $customer_id);
     } else {
         // build the list of recipients
         $recipients = array();
         $recipient_emails = array();
         foreach ($sup_ids as $sup_id) {
             $senders = Support::getSender(array($sup_id));
             if (count($senders) > 0) {
                 $sender_email = Mail_Helper::getEmailAddress($senders[0]);
                 $recipients[$sup_id] = $senders[0];
                 $recipient_emails[] = $sender_email;
             }
         }
         if (!$recipients) {
             return false;
         }
         $data = Issue::getDetails($issue_id);
         foreach ($recipients as $sup_id => $recipient) {
             $recipient_usr_id = User::getUserIDByEmail(Mail_Helper::getEmailAddress($recipient));
             // open text template
             $tpl = new Template_Helper();
             $tpl->setTemplate('notifications/new_auto_created_issue.tpl.text');
             $tpl->assign(array('data' => $data, 'sender_name' => Mail_Helper::getName($recipient), 'app_title' => Misc::getToolCaption(), 'recipient_name' => Mail_Helper::getName($recipient)));
             $email_details = Support::getEmailDetails(Email_Account::getAccountByEmail($sup_id), $sup_id);
             $tpl->assign(array('email' => array('date' => $email_details['sup_date'], 'from' => $email_details['sup_from'], 'subject' => $email_details['sup_subject'])));
             // change the current locale
             if (!empty($recipient_usr_id)) {
                 Language::set(User::getLang($recipient_usr_id));
             } else {
                 Language::set(APP_DEFAULT_LOCALE);
             }
             $text_message = $tpl->getTemplateContents();
             // send email (use PEAR's classes)
             $mail = new Mail_Helper();
             $mail->setTextBody($text_message);
             $setup = $mail->getSMTPSettings();
             $from = self::getFixedFromHeader($issue_id, $setup['from'], 'issue');
             $mail->setHeaders(Mail_Helper::getBaseThreadingHeaders($issue_id));
             // TRANSLATORS: %1 - issue_id, %2 - iss_summary
             $subject = ev_gettext('[#%1$s] Issue Created: %2$s', $issue_id, $data['iss_summary']);
             $mail->send($from, $recipient, $subject, 1, $issue_id, 'email_converted_to_issue');
         }
         Language::restore();
         return $recipient_emails;
     }
 }
开发者ID:dabielkabuto,项目名称:eventum,代码行数:61,代码来源:class.notification.php

示例4: getCustomerInfoFromEmails

 /**
  * Method used to get the associated customer and customer contact from
  * a given set of support emails. This is especially useful to automatically
  * associate an issue to the appropriate customer contact that sent a
  * support email.
  *
  * @access  public
  * @param   array $sup_ids The list of support email IDs
  * @return  array The customer and customer contact ID
  */
 function getCustomerInfoFromEmails($sup_ids)
 {
     $senders = Support::getSender($sup_ids);
     if (count($senders) > 0) {
         $emails = array();
         for ($i = 0; $i < count($senders); $i++) {
             $emails[] = Mail_API::getEmailAddress($senders[$i]);
         }
         list($customer_id, $contact_id) = $this->getCustomerIDByEmails($emails);
         $company = $this->getDetails($customer_id);
         $contact = $this->getContactDetails($contact_id);
         return array('customer_id' => $customer_id, 'customer_name' => $company['customer_name'], 'contact_id' => $contact_id, 'contact_name' => $contact['first_name'] . " " . $contact['last_name'], 'contacts' => $this->getContactEmailAssocList($customer_id));
     } else {
         return array('customer_id' => '', 'customer_name' => '', 'contact_id' => '', 'contact_name' => '', 'contacts' => '');
     }
 }
开发者ID:juliogallardo1326,项目名称:proc,代码行数:26,代码来源:class.example.php

示例5: notifyEmailConvertedIntoIssue

 /**
  * Method used to send an email notification to the sender of a
  * set of email messages that were manually converted into an
  * issue.
  *
  * @access  public
  * @param   integer $prj_id The project ID
  * @param   integer $issue_id The issue ID
  * @param   array $sup_ids The email IDs
  * @param   integer $customer_id The customer ID
  * @return  array The list of recipient emails
  */
 function notifyEmailConvertedIntoIssue($prj_id, $issue_id, $sup_ids, $customer_id = FALSE)
 {
     if (Customer::hasCustomerIntegration($prj_id)) {
         return Customer::notifyEmailConvertedIntoIssue($prj_id, $issue_id, $sup_ids, $customer_id);
     } else {
         // build the list of recipients
         $recipients = array();
         $recipient_emails = array();
         for ($i = 0; $i < count($sup_ids); $i++) {
             $senders = Support::getSender(array($sup_ids[$i]));
             if (count($senders) > 0) {
                 $sender_email = Mail_API::getEmailAddress($senders[0]);
                 $recipients[$sup_ids[$i]] = $senders[0];
                 $recipient_emails[] = $sender_email;
             }
         }
         if (count($recipients) == 0) {
             return false;
         }
         $data = Issue::getDetails($issue_id);
         foreach ($recipients as $sup_id => $recipient) {
             // open text template
             $tpl = new Template_API();
             $tpl->setTemplate('notifications/new_auto_created_issue.tpl.text');
             $tpl->bulkAssign(array("data" => $data, "sender_name" => Mail_API::getName($recipient)));
             $email_details = Support::getEmailDetails(Email_Account::getAccountByEmail($sup_id), $sup_id);
             $tpl->assign(array('email' => array('date' => $email_details['sup_date'], 'from' => $email_details['sup_from'], 'subject' => $email_details['sup_subject'])));
             $text_message = $tpl->getTemplateContents();
             // send email (use PEAR's classes)
             $mail = new Mail_API();
             $mail->setTextBody($text_message);
             $setup = $mail->getSMTPSettings();
             $from = Notification::getFixedFromHeader($issue_id, $setup["from"], 'issue');
             $mail->setHeaders(Mail_API::getBaseThreadingHeaders($issue_id));
             $mail->send($from, $recipient, 'New Issue Created', 1, $issue_id, 'email_converted_to_issue');
         }
         return $recipient_emails;
     }
 }
开发者ID:juliogallardo1326,项目名称:proc,代码行数:51,代码来源:class.notification.php


注:本文中的Support::getSender方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。