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


PHP CRM_Contribute_BAO_Contribution::sendMail方法代码示例

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


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

示例1: sendMail

 /**
  * Send receipt from contribution.
  *
  * @deprecated
  *
  * Note that the compose message part has been moved to contribution
  * In general LoadObjects is called first to get the objects but the composeMessageArray function now calls it
  *
  * @param array $input
  *   Incoming data from Payment processor.
  * @param array $ids
  *   Related object IDs.
  * @param array $objects
  * @param array $values
  *   Values related to objects that have already been loaded.
  * @param bool $recur
  *   Is it part of a recurring contribution.
  * @param bool $returnMessageText
  *   Should text be returned instead of sent. This.
  *   is because the function is also used to generate pdfs
  *
  * @return array
  */
 public function sendMail(&$input, &$ids, &$objects, &$values, $recur = FALSE, $returnMessageText = FALSE)
 {
     return CRM_Contribute_BAO_Contribution::sendMail($input, $ids, $objects['contribution'], $values, $recur, $returnMessageText);
 }
开发者ID:hyebahi,项目名称:civicrm-core,代码行数:27,代码来源:BaseIPN.php

示例2: postProcess

 /**
  * Process the form after the input has been submitted and validated.
  */
 public function postProcess()
 {
     // get all the details needed to generate a receipt
     $message = array();
     $template = CRM_Core_Smarty::singleton();
     $params = $this->controller->exportValues($this->_name);
     $elements = self::getElements($this->_contributionIds, $params, $this->_contactIds);
     foreach ($elements['details'] as $contribID => $detail) {
         $input = $ids = $objects = array();
         if (in_array($detail['contact'], $elements['excludeContactIds'])) {
             continue;
         }
         $input['component'] = $detail['component'];
         $ids['contact'] = $detail['contact'];
         $ids['contribution'] = $contribID;
         $ids['contributionRecur'] = NULL;
         $ids['contributionPage'] = NULL;
         $ids['membership'] = CRM_Utils_Array::value('membership', $detail);
         $ids['participant'] = CRM_Utils_Array::value('participant', $detail);
         $ids['event'] = CRM_Utils_Array::value('event', $detail);
         if (!$elements['baseIPN']->validateData($input, $ids, $objects, FALSE)) {
             CRM_Core_Error::fatal();
         }
         $contribution =& $objects['contribution'];
         // set some fake input values so we can reuse IPN code
         $input['amount'] = $contribution->total_amount;
         $input['is_test'] = $contribution->is_test;
         $input['fee_amount'] = $contribution->fee_amount;
         $input['net_amount'] = $contribution->net_amount;
         $input['trxn_id'] = $contribution->trxn_id;
         $input['trxn_date'] = isset($contribution->trxn_date) ? $contribution->trxn_date : NULL;
         $input['receipt_update'] = $params['receipt_update'];
         $input['contribution_status_id'] = $contribution->contribution_status_id;
         // CRM_Contribute_BAO_Contribution::composeMessageArray expects mysql formatted date
         $objects['contribution']->receive_date = CRM_Utils_Date::isoToMysql($objects['contribution']->receive_date);
         $values = array();
         $mail = CRM_Contribute_BAO_Contribution::sendMail($input, $ids, $objects['contribution'], $values, FALSE, $elements['createPdf']);
         if ($mail['html']) {
             $message[] = $mail['html'];
         } else {
             $message[] = nl2br($mail['body']);
         }
         // reset template values before processing next transactions
         $template->clearTemplateVars();
     }
     if ($elements['createPdf']) {
         CRM_Utils_PDF_Utils::html2pdf($message, 'civicrmContributionReceipt.pdf', FALSE, $elements['params']['pdf_format_id']);
         CRM_Utils_System::civiExit();
     } else {
         if ($elements['suppressedEmails']) {
             $status = ts('Email was NOT sent to %1 contacts (no email address on file, or communication preferences specify DO NOT EMAIL, or contact is deceased).', array(1 => $elements['suppressedEmails']));
             $msgTitle = ts('Email Error');
             $msgType = 'error';
         } else {
             $status = ts('Your mail has been sent.');
             $msgTitle = ts('Sent');
             $msgType = 'success';
         }
         CRM_Core_Session::setStatus($status, $msgTitle, $msgType);
     }
 }
开发者ID:scardinius,项目名称:civicrm-core,代码行数:64,代码来源:PDF.php

示例3: civicrm_api3_contribution_sendconfirmation

/**
 * Send a contribution confirmation (receipt or invoice).
 *
 * The appropriate online template will be used (the existence of related objects
 * (e.g. memberships ) will affect this selection
 *
 * @param array $params
 *   Input parameters.
 *
 * @throws Exception
 */
function civicrm_api3_contribution_sendconfirmation($params)
{
    $input = $ids = $values = array();
    $passThroughParams = array('receipt_from_email', 'receipt_from_name', 'receipt_update', 'cc_receipt', 'bcc_receipt', 'receipt_text', 'payment_processor_id');
    foreach ($passThroughParams as $key) {
        if (isset($params[$key])) {
            $input[$key] = $params[$key];
        }
    }
    CRM_Contribute_BAO_Contribution::sendMail($input, $ids, $params['id'], $values);
}
开发者ID:nielosz,项目名称:civicrm-core,代码行数:22,代码来源:Contribution.php


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