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


PHP CRM_Mailing_Event_BAO_Queue::getContactInfo方法代码示例

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


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

示例1: preProcess

 public function preProcess()
 {
     $this->_type = 'unsubscribe';
     $this->_job_id = $job_id = CRM_Utils_Request::retrieve('jid', 'Integer', $this);
     $this->_queue_id = $queue_id = CRM_Utils_Request::retrieve('qid', 'Integer', $this);
     $this->_hash = $hash = CRM_Utils_Request::retrieve('h', 'String', $this);
     if (!$job_id || !$queue_id || !$hash) {
         CRM_Core_Error::fatal(ts("Missing Parameters"));
     }
     // verify that the three numbers above match
     $q = CRM_Mailing_Event_BAO_Queue::verify($job_id, $queue_id, $hash);
     if (!$q) {
         CRM_Core_Error::fatal(ts("There was an error in your request"));
     }
     list($displayName, $email) = CRM_Mailing_Event_BAO_Queue::getContactInfo($queue_id);
     $this->assign('display_name', $displayName);
     $emailMasked = CRM_Utils_String::maskEmail($email);
     $this->assign('email_masked', $emailMasked);
     $this->assign('email', $email);
     $this->_email = $email;
     $groups = CRM_Mailing_Event_BAO_Unsubscribe::unsub_from_mailing($job_id, $queue_id, $hash, TRUE);
     $this->assign('groups', $groups);
     $groupExist = NULL;
     foreach ($groups as $key => $value) {
         if ($value) {
             $groupExist = TRUE;
         }
     }
     if (!$groupExist) {
         $statusMsg = ts('Email: %1 has been successfully unsubscribed from this Mailing List/Group.', array(1 => $email));
         CRM_Core_Session::setStatus($statusMsg, '', 'fail');
     }
     $this->assign('groupExist', $groupExist);
 }
开发者ID:FundingWorks,项目名称:civicrm-core,代码行数:34,代码来源:Unsubscribe.php

示例2: preProcess

 public function preProcess()
 {
     $this->_type = 'optout';
     $this->_job_id = $job_id = CRM_Utils_Request::retrieve('jid', 'Integer', $this);
     $this->_queue_id = $queue_id = CRM_Utils_Request::retrieve('qid', 'Integer', $this);
     $this->_hash = $hash = CRM_Utils_Request::retrieve('h', 'String', $this);
     if (!$job_id || !$queue_id || !$hash) {
         CRM_Core_Error::fatal(ts("Missing input parameters"));
     }
     // verify that the three numbers above match
     $q = CRM_Mailing_Event_BAO_Queue::verify($job_id, $queue_id, $hash);
     if (!$q) {
         CRM_Core_Error::fatal(ts("There was an error in your request"));
     }
     list($displayName, $email) = CRM_Mailing_Event_BAO_Queue::getContactInfo($queue_id);
     $this->assign('display_name', $displayName);
     $emailMasked = CRM_Utils_String::maskEmail($email);
     $this->assign('email_masked', $emailMasked);
     $this->assign('email', $email);
     $this->_email = $email;
 }
开发者ID:kidaa30,项目名称:yes,代码行数:21,代码来源:Optout.php

示例3: run

 /**
  * Run page.
  *
  * This includes assigning smarty variables and other page processing.
  *
  * @return string
  * @throws Exception
  */
 public function run()
 {
     $job_id = CRM_Utils_Request::retrieve('jid', 'Integer', CRM_Core_DAO::$_nullObject);
     $queue_id = CRM_Utils_Request::retrieve('qid', 'Integer', CRM_Core_DAO::$_nullObject);
     $hash = CRM_Utils_Request::retrieve('h', 'String', CRM_Core_DAO::$_nullObject);
     if (!$job_id || !$queue_id || !$hash) {
         CRM_Core_Error::fatal(ts("Missing input parameters"));
     }
     // verify that the three numbers above match
     $q = CRM_Mailing_Event_BAO_Queue::verify($job_id, $queue_id, $hash);
     if (!$q) {
         CRM_Core_Error::fatal(ts("There was an error in your request"));
     }
     $cancel = CRM_Utils_Request::retrieve("_qf_{$this->_type}_cancel", 'String', CRM_Core_DAO::$_nullObject, FALSE, NULL, $_REQUEST);
     if ($cancel) {
         $config = CRM_Core_Config::singleton();
         CRM_Utils_System::redirect($config->userFrameworkBaseURL);
     }
     $confirm = CRM_Utils_Request::retrieve('confirm', 'Boolean', CRM_Core_DAO::$_nullObject, FALSE, NULL, $_REQUEST);
     list($displayName, $email) = CRM_Mailing_Event_BAO_Queue::getContactInfo($queue_id);
     $this->assign('display_name', $displayName);
     $this->assign('email', $email);
     $this->assign('confirm', $confirm);
     $groups = CRM_Mailing_Event_BAO_Unsubscribe::unsub_from_mailing($job_id, $queue_id, $hash, TRUE);
     $this->assign('groups', $groups);
     $groupExist = NULL;
     foreach ($groups as $key => $value) {
         if ($value) {
             $groupExist = TRUE;
         }
     }
     $this->assign('groupExist', $groupExist);
     if ($confirm) {
         if ($this->_type == 'unsubscribe') {
             $groups = CRM_Mailing_Event_BAO_Unsubscribe::unsub_from_mailing($job_id, $queue_id, $hash);
             if (count($groups)) {
                 CRM_Mailing_Event_BAO_Unsubscribe::send_unsub_response($queue_id, $groups, FALSE, $job_id);
             } else {
                 // should we indicate an error, or just ignore?
             }
         } elseif ($this->_type == 'resubscribe') {
             $groups = CRM_Mailing_Event_BAO_Resubscribe::resub_to_mailing($job_id, $queue_id, $hash);
             if (count($groups)) {
                 CRM_Mailing_Event_BAO_Resubscribe::send_resub_response($queue_id, $groups, FALSE, $job_id);
             } else {
                 // should we indicate an error, or just ignore?
             }
         } else {
             if (CRM_Mailing_Event_BAO_Unsubscribe::unsub_from_domain($job_id, $queue_id, $hash)) {
                 CRM_Mailing_Event_BAO_Unsubscribe::send_unsub_response($queue_id, NULL, TRUE, $job_id);
             } else {
                 // should we indicate an error, or just ignore?
             }
         }
     } else {
         $confirmURL = CRM_Utils_System::url("civicrm/mailing/{$this->_type}", "reset=1&jid={$job_id}&qid={$queue_id}&h={$hash}&confirm=1");
         $this->assign('confirmURL', $confirmURL);
         // push context for further process CRM-4431
         $session = CRM_Core_Session::singleton();
         $session->pushUserContext($confirmURL);
     }
     return parent::run();
 }
开发者ID:FundingWorks,项目名称:civicrm-core,代码行数:71,代码来源:Common.php


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