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


PHP CRM_Mailing_BAO_Mailing::getMailingContent方法代码示例

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


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

示例1: civicrm_api3_job_rapportagenamailings_mail

/**
 * Send a email to ?? with the mailing report of one mailing
 * 
 * @param type $mailing_id
 */
function civicrm_api3_job_rapportagenamailings_mail($mailing_id)
{
    global $base_root;
    // create a new Cor Page
    $page = new CRM_Core_Page();
    $page->_mailing_id = $mailing_id;
    // create a new template
    $template = CRM_Core_Smarty::singleton();
    // from CRM/Mailing/Page/Report.php
    // check that the user has permission to access mailing id
    CRM_Mailing_BAO_Mailing::checkPermission($mailing_id);
    $report = CRM_Mailing_BAO_Mailing::report($mailing_id);
    //get contents of mailing
    CRM_Mailing_BAO_Mailing::getMailingContent($report, $page);
    $subject = ts('Mailing Gereed: %1', array(1 => $report['mailing']['name']));
    $template->assign('report', $report);
    // inlcude $base_root
    $template->assign('base_root', $base_root);
    $template->assign('subject', $subject);
    // from CRM/Core/page.php
    // only print
    $template->assign('tplFile', 'CRM/Rapportagenamailings/Page/RapportMailing.tpl');
    $content = $template->fetch('CRM/common/print.tpl');
    CRM_Utils_System::appendTPLFile('CRM/Rapportagenamailings/Page/RapportMailing.tpl', $content, $page->overrideExtraTemplateFileName());
    //its time to call the hook.
    CRM_Utils_Hook::alterContent($content, 'page', 'CRM/Rapportagenamailings/Page/RapportMailing.tpl', $page);
    //echo $content;
    // send mail
    $params = array('from' => 'frontoffice@vnv.nl', 'toName' => 'Front Office VnV', 'toEmail' => 'frontoffice@vnv.nl', 'subject' => $subject, 'text' => $subject, 'html' => $content, 'replyTo' => 'frontoffice@vnv.nl');
    CRM_Utils_Mail::send($params);
}
开发者ID:jvos,项目名称:nl.vnv.rapportagenamailings_old,代码行数:36,代码来源:RapportageNaMailings.php

示例2: run

 function run()
 {
     $this->_mailing_id = CRM_Utils_Request::retrieve('mid', 'Positive', $this);
     // check that the user has permission to access mailing id
     CRM_Mailing_BAO_Mailing::checkPermission($this->_mailing_id);
     $report = CRM_Mailing_BAO_Mailing::report($this->_mailing_id);
     //get contents of mailing
     CRM_Mailing_BAO_Mailing::getMailingContent($report, $this);
     //assign backurl
     $context = CRM_Utils_Request::retrieve('context', 'String', $this);
     $cid = CRM_Utils_Request::retrieve('cid', 'Positive', $this);
     if ($context == 'activitySelector') {
         $backUrl = CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid={$cid}&selectedChild=activity");
         $backUrlTitle = ts('Back to Activities');
     } elseif ($context == 'activity') {
         $atype = CRM_Utils_Request::retrieve('atype', 'Positive', $this);
         $aid = CRM_Utils_Request::retrieve('aid', 'Positive', $this);
         $backUrl = CRM_Utils_System::url('civicrm/activity/view', "atype={$atype}&action=view&reset=1&id={$aid}&cid={$cid}&context=activity");
         $backUrlTitle = ts('Back to Activity');
     } elseif ($context == 'mailing') {
         $backUrl = CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid={$cid}&selectedChild=mailing");
         $backUrlTitle = ts('Back to Mailing');
     } else {
         $backUrl = CRM_Utils_System::url('civicrm/mailing', 'reset=1');
         $backUrlTitle = ts('Back to CiviMail');
     }
     $this->assign('backUrl', $backUrl);
     $this->assign('backUrlTitle', $backUrlTitle);
     $this->assign('report', $report);
     CRM_Utils_System::setTitle(ts('CiviMail Report: %1', array(1 => $report['mailing']['name'])));
     return CRM_Core_Page::run();
 }
开发者ID:hguru,项目名称:224Civi,代码行数:32,代码来源:Report.php

示例3: preProcess

 /**
  * Function to set variables up before form is built
  *
  * @return void
  * @access public
  */
 public function preProcess()
 {
     //get the activity values
     $activityId = CRM_Utils_Request::retrieve('id', 'Positive', $this);
     $context = CRM_Utils_Request::retrieve('context', 'String', $this);
     $cid = CRM_Utils_Request::retrieve('cid', 'Positive', $this);
     //check for required permissions, CRM-6264
     if ($activityId && !CRM_Activity_BAO_Activity::checkPermission($activityId, CRM_Core_Action::VIEW)) {
         CRM_Core_Error::fatal(ts('You do not have permission to access this page.'));
     }
     $session = CRM_Core_Session::singleton();
     if (!in_array($context, array('home', 'dashlet', 'dashletFullscreen'))) {
         $url = CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid={$cid}&selectedChild=activity");
     } else {
         $url = CRM_Utils_System::url('civicrm/dashboard', 'reset=1');
     }
     $session->pushUserContext($url);
     $defaults = array();
     $params = array('id' => $activityId);
     CRM_Activity_BAO_Activity::retrieve($params, $defaults);
     //set activity type name and description to template
     list($activityTypeName, $activityTypeDescription) = CRM_Core_BAO_OptionValue::getActivityTypeDetails($defaults['activity_type_id']);
     $this->assign('activityTypeName', $activityTypeName);
     $this->assign('activityTypeDescription', $activityTypeDescription);
     if (CRM_Utils_Array::value('mailingId', $defaults)) {
         $this->_mailing_id = CRM_Utils_Array::value('source_record_id', $defaults);
         $mailingReport = CRM_Mailing_BAO_Mailing::report($this->_mailing_id, TRUE);
         CRM_Mailing_BAO_Mailing::getMailingContent($mailingReport, $this);
         $this->assign('mailingReport', $mailingReport);
         $full_open_report = CRM_Mailing_Event_BAO_Opened::getRows($this->_mailing_id, NULL, FALSE, NULL, NULL, NULL, $cid);
         $this->assign('openreport', $full_open_report);
         $click_thru_report = CRM_Mailing_Event_BAO_TrackableURLOpen::getRows($this->_mailing_id, NULL, FALSE, NULL, NULL, NULL, NULL, $cid);
         $this->assign('clickreport', $click_thru_report);
     }
     foreach ($defaults as $key => $value) {
         if (substr($key, -3) != '_id') {
             $values[$key] = $value;
         }
     }
     //get the campaign
     if ($campaignId = CRM_Utils_Array::value('campaign_id', $defaults)) {
         $campaigns = CRM_Campaign_BAO_Campaign::getCampaigns($campaignId);
         $values['campaign'] = $campaigns[$campaignId];
     }
     if ($engagementLevel = CRM_Utils_Array::value('engagement_level', $defaults)) {
         $engagementLevels = CRM_Campaign_PseudoConstant::engagementLevel();
         $values['engagement_level'] = CRM_Utils_Array::value($engagementLevel, $engagementLevels, $engagementLevel);
     }
     $values['attachment'] = CRM_Core_BAO_File::attachmentInfo('civicrm_activity', $activityId);
     $this->assign('values', $values);
 }
开发者ID:hguru,项目名称:224Civi,代码行数:57,代码来源:ActivityView.php

示例4: preProcess

 /**  
  * Function to set variables up before form is built  
  *                                                            
  * @return void  
  * @access public  
  */
 public function preProcess()
 {
     //get the activity values
     $activityId = CRM_Utils_Request::retrieve('id', 'Positive', $this);
     $context = CRM_Utils_Request::retrieve('context', 'String', $this);
     $cid = CRM_Utils_Request::retrieve('cid', 'Positive', $this);
     //check for required permissions, CRM-6264
     if ($activityId && !CRM_Activity_BAO_Activity::checkPermission($activityId, CRM_Core_Action::VIEW)) {
         CRM_Core_Error::fatal(ts('You do not have permission to access this page.'));
     }
     $session = CRM_Core_Session::singleton();
     if ($context != 'home') {
         $url = CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid={$cid}&selectedChild=activity");
     } else {
         $url = CRM_Utils_System::url('civicrm/dashboard', 'reset=1');
     }
     $session->pushUserContext($url);
     $params = array('id' => $activityId);
     CRM_Activity_BAO_Activity::retrieve($params, $defaults);
     //set activity type name and description to template
     require_once 'CRM/Core/BAO/OptionValue.php';
     list($activityTypeName, $activityTypeDescription) = CRM_Core_BAO_OptionValue::getActivityTypeDetails($defaults['activity_type_id']);
     $this->assign('activityTypeName', $activityTypeName);
     $this->assign('activityTypeDescription', $activityTypeDescription);
     if (CRM_Utils_Array::value('mailingId', $defaults)) {
         $this->_mailing_id = CRM_Utils_Array::value('source_record_id', $defaults);
         require_once 'CRM/Mailing/BAO/Mailing.php';
         $mailingReport =& CRM_Mailing_BAO_Mailing::report($this->_mailing_id, true);
         CRM_Mailing_BAO_Mailing::getMailingContent($mailingReport, $this);
         $this->assign('mailingReport', $mailingReport);
     }
     foreach ($defaults as $key => $value) {
         if (substr($key, -3) != '_id') {
             $values[$key] = $value;
         }
     }
     require_once 'CRM/Core/BAO/File.php';
     $values['attachment'] = CRM_Core_BAO_File::attachmentInfo('civicrm_activity', $activityId);
     $this->assign('values', $values);
 }
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:46,代码来源:ActivityView.php

示例5: run

 function run()
 {
     $this->_mailing_id = CRM_Utils_Request::retrieve('mid', 'Positive', $this);
     // check that the user has permission to access mailing id
     require_once 'CRM/Mailing/BAO/Mailing.php';
     CRM_Mailing_BAO_Mailing::checkPermission($this->_mailing_id);
     require_once 'CRM/Mailing/BAO/Mailing.php';
     $report =& CRM_Mailing_BAO_Mailing::report($this->_mailing_id);
     // #6835 Email Mutithreading
     //if ( count($report['jobs']) > 1 ) {
     //    CRM_Core_Error::statusBounce(ts('Selected Mailing has more than one live job.'));
     //}
     //get contents of mailing
     CRM_Mailing_BAO_Mailing::getMailingContent($report, $this);
     //assign backurl
     $context = CRM_Utils_Request::retrieve('context', 'String', $this);
     $cid = CRM_Utils_Request::retrieve('cid', 'Positive', $this);
     if ($context == 'activitySelector') {
         $backUrl = CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid={$cid}&selectedChild=activity");
         $backUrlTitle = ts('Back to Activities');
     } else {
         if ($context == 'activity') {
             $atype = CRM_Utils_Request::retrieve('atype', 'Positive', $this);
             $aid = CRM_Utils_Request::retrieve('aid', 'Positive', $this);
             $backUrl = CRM_Utils_System::url('civicrm/activity/view', "atype={$atype}&action=view&reset=1&id={$aid}&cid={$cid}&context=activity");
             $backUrlTitle = ts('Back to Activity');
         } else {
             $backUrl = CRM_Utils_System::url('civicrm/mailing', 'reset=1');
             $backUrlTitle = ts('Back to CiviMail');
         }
     }
     $this->assign('backUrl', $backUrl);
     $this->assign('backUrlTitle', $backUrlTitle);
     $this->assign('report', $report);
     CRM_Utils_System::setTitle(ts('CiviMail Report: %1', array(1 => $report['mailing']['name'])));
     parent::run();
 }
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:37,代码来源:Report.php

示例6: run

 /**
  * @return string
  */
 public function run()
 {
     $this->_mailing_id = CRM_Utils_Request::retrieve('mid', 'Positive', $this);
     //CRM-15979 - check if abtest exist for mailing then redirect accordingly
     $abtest = CRM_Mailing_BAO_MailingAB::getABTest($this->_mailing_id);
     if (!empty($abtest) && !empty($abtest->id)) {
         CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/a/', NULL, TRUE, '/abtest/' . $abtest->id));
     }
     // check that the user has permission to access mailing id
     CRM_Mailing_BAO_Mailing::checkPermission($this->_mailing_id);
     $report = CRM_Mailing_BAO_Mailing::report($this->_mailing_id);
     // get contents of mailing
     CRM_Mailing_BAO_Mailing::getMailingContent($report, $this);
     // assign backurl
     $context = CRM_Utils_Request::retrieve('context', 'String', $this);
     $cid = CRM_Utils_Request::retrieve('cid', 'Positive', $this);
     if ($context == 'activitySelector') {
         $backUrl = CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid={$cid}&selectedChild=activity");
         $backUrlTitle = ts('Back to Activities');
     } elseif ($context == 'activity') {
         $atype = CRM_Utils_Request::retrieve('atype', 'Positive', $this);
         $aid = CRM_Utils_Request::retrieve('aid', 'Positive', $this);
         $backUrl = CRM_Utils_System::url('civicrm/activity/view', "atype={$atype}&action=view&reset=1&id={$aid}&cid={$cid}&context=activity");
         $backUrlTitle = ts('Back to Activity');
     } elseif ($context == 'mailing') {
         $backUrl = CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid={$cid}&selectedChild=mailing");
         $backUrlTitle = ts('Back to Mailing');
     } else {
         $backUrl = CRM_Utils_System::url('civicrm/mailing', 'reset=1');
         $backUrlTitle = ts('Back to CiviMail');
     }
     $this->assign('backUrl', $backUrl);
     $this->assign('backUrlTitle', $backUrlTitle);
     $this->assign('report', $report);
     CRM_Utils_System::setTitle(ts('CiviMail Report: %1', array(1 => $report['mailing']['name'])));
     $this->assign('public_url', CRM_Mailing_BAO_Mailing::getPublicViewUrl($this->_mailing_id));
     return CRM_Core_Page::run();
 }
开发者ID:kcristiano,项目名称:civicrm-core,代码行数:41,代码来源:Report.php


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