本文整理汇总了PHP中CRM_Mailing_BAO_Mailing::getReturnProperties方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Mailing_BAO_Mailing::getReturnProperties方法的具体用法?PHP CRM_Mailing_BAO_Mailing::getReturnProperties怎么用?PHP CRM_Mailing_BAO_Mailing::getReturnProperties使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Mailing_BAO_Mailing
的用法示例。
在下文中一共展示了CRM_Mailing_BAO_Mailing::getReturnProperties方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildQuickForm
public function buildQuickForm()
{
$session = CRM_Core_Session::singleton();
$this->add('text', 'test_email', ts('Send to This Address'));
$defaults['test_email'] = $session->get('ufUniqID');
$qfKey = $this->get('qfKey');
$this->add('select', 'test_group', ts('Send to This Group'), array('' => ts('- none -')) + CRM_Core_PseudoConstant::group('Mailing'));
$this->setDefaults($defaults);
$this->add('submit', 'sendtest', ts('Send a Test Mailing'));
$name = ts('Next');
if (CRM_Mailing_Info::workflowEnabled()) {
if (!CRM_Core_Permission::check('schedule mailings') && CRM_Core_Permission::check('create mailings')) {
$name = ts('Inform Scheduler');
}
}
$buttons = array(array('type' => 'back', 'name' => ts('Previous')), array('type' => 'next', 'name' => $name, 'spacing' => ' ', 'isDefault' => TRUE), array('type' => 'submit', 'name' => ts('Save & Continue Later')), array('type' => 'cancel', 'name' => ts('Cancel')));
$this->addButtons($buttons);
$mailingID = $this->get('mailing_id');
$textFile = $this->get('textFile');
$htmlFile = $this->get('htmlFile');
$this->addFormRule(array('CRM_Mailing_Form_Test', 'testMail'), $this);
$preview = array();
if ($textFile) {
$preview['text_link'] = CRM_Utils_System::url('civicrm/mailing/preview', "type=text&qfKey={$qfKey}");
}
if ($htmlFile) {
$preview['html_link'] = CRM_Utils_System::url('civicrm/mailing/preview', "type=html&qfKey={$qfKey}");
}
$preview['attachment'] = CRM_Core_BAO_File::attachmentInfo('civicrm_mailing', $mailingID);
$this->assign('preview', $preview);
//Token Replacement of Subject in preview mailing
$options = array();
$prefix = "CRM_Mailing_Controller_Send_{$qfKey}";
if ($this->_searchBasedMailing) {
$prefix = "CRM_Contact_Controller_Search_{$qfKey}";
}
$session->getVars($options, $prefix);
$mailing = new CRM_Mailing_BAO_Mailing();
$mailing->id = $options['mailing_id'];
$mailing->find(TRUE);
$fromEmail = $mailing->from_email;
$replyToEmail = $mailing->replyto_email;
$attachments = CRM_Core_BAO_File::getEntityFile('civicrm_mailing', $mailing->id);
$returnProperties = $mailing->getReturnProperties();
$userID = $session->get('userID');
$params = array('contact_id' => $userID);
$details = CRM_Utils_Token::getTokenDetails($params, $returnProperties, TRUE, TRUE, NULL, $mailing->getFlattenedTokens(), get_class($this));
$allDetails =& $mailing->compose(NULL, NULL, NULL, $userID, $fromEmail, $fromEmail, TRUE, $details[0][$userID], $attachments);
$this->assign('subject', $allDetails->_headers['Subject']);
}
示例2: buildQuickForm
public function buildQuickForm()
{
$session = CRM_Core_Session::singleton();
$this->add('text', 'test_email', ts('Send to This Address'));
$defaults['test_email'] = $session->get('ufUniqID');
$qfKey = $this->get('qfKey');
$this->add('select', 'test_group', ts('Send to This Group'), array('' => ts('- none -')) + CRM_Core_PseudoConstant::group('Mailing'));
$this->setDefaults($defaults);
$this->add('submit', 'sendtest', ts('Send a Test Mailing'));
$name = ts('Next >>');
require_once 'CRM/Mailing/Info.php';
if (CRM_Mailing_Info::workflowEnabled()) {
if (!CRM_Core_Permission::check('schedule mailings') && CRM_Core_Permission::check('create mailings')) {
$name = ts('Inform Scheduler');
}
}
//FIXME : currently we are hiding save an continue later when
//search base mailing, we should handle it when we fix CRM-3876
$buttons = array(array('type' => 'back', 'name' => ts('<< Previous')), array('type' => 'next', 'name' => $name, 'spacing' => ' ', 'isDefault' => true), array('type' => 'submit', 'name' => ts('Save & Continue Later')), array('type' => 'cancel', 'name' => ts('Cancel')));
if ($this->_searchBasedMailing && $this->get('ssID')) {
$buttons = array(array('type' => 'back', 'name' => ts('<< Previous')), array('type' => 'next', 'name' => $name, 'spacing' => ' ', 'isDefault' => true), array('type' => 'cancel', 'name' => ts('Cancel')));
}
$this->addButtons($buttons);
$mailingID = $this->get('mailing_id');
$textFile = $this->get('textFile');
$htmlFile = $this->get('htmlFile');
$this->addFormRule(array('CRM_Mailing_Form_Test', 'testMail'), $this);
$preview = array();
if ($textFile) {
$preview['text_link'] = CRM_Utils_System::url('civicrm/mailing/preview', "type=text&qfKey={$qfKey}");
}
if ($htmlFile) {
$preview['html_link'] = CRM_Utils_System::url('civicrm/mailing/preview', "type=html&qfKey={$qfKey}");
}
require_once 'CRM/Core/BAO/File.php';
$preview['attachment'] = CRM_Core_BAO_File::attachmentInfo('civicrm_mailing', $mailingID);
$this->assign('preview', $preview);
//Token Replacement of Subject in preview mailing
$options = array();
$prefix = "CRM_Mailing_Controller_Send_{$qfKey}";
if ($this->_searchBasedMailing) {
$prefix = "CRM_Contact_Controller_Search_{$qfKey}";
}
$session->getVars($options, $prefix);
require_once 'CRM/Mailing/BAO/Mailing.php';
$mailing = new CRM_Mailing_BAO_Mailing();
$mailing->id = $options['mailing_id'];
$mailing->find(true);
$fromEmail = $mailing->from_email;
require_once 'CRM/Core/BAO/File.php';
$attachments =& CRM_Core_BAO_File::getEntityFile('civicrm_mailing', $mailing->id);
$returnProperties = $mailing->getReturnProperties();
$userID = $session->get('userID');
$params = array('contact_id' => $userID);
$details = $mailing->getDetails($params, $returnProperties);
$allDetails =& $mailing->compose(null, null, null, $userID, $fromEmail, $fromEmail, true, $details[0][$userID], $attachments);
$this->assign('subject', $allDetails->_headers['Subject']);
}