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


PHP CRM_Contribute_BAO_Contribution::composeMessageArray方法代码示例

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


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

示例1: 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)
{
    $contribution = new CRM_Contribute_BAO_Contribution();
    $contribution->id = $params['id'];
    if (!$contribution->find(TRUE)) {
        throw new Exception('Contribution does not exist');
    }
    $input = $ids = $cvalues = array('receipt_from_email' => $params['receipt_from_email']);
    $contribution->loadRelatedObjects($input, $ids, TRUE);
    $contribution->composeMessageArray($input, $ids, $cvalues, FALSE, FALSE);
}
开发者ID:scardinius,项目名称:civicrm-core,代码行数:22,代码来源:Contribution.php

示例2: sendMail

 /**
  * Send receipt from contribution.
  *
  * Do not call this directly - it is being refactored. use contribution.sendmessage api call.
  *
  * 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 CRM_Contribute_BAO_Contribution $contribution
  * @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 static function sendMail(&$input, &$ids, $contribution, &$values, $recur = FALSE, $returnMessageText = FALSE)
 {
     $input['is_recur'] = $recur;
     // set receipt from e-mail and name in value
     if (!$returnMessageText) {
         $session = CRM_Core_Session::singleton();
         $userID = $session->get('userID');
         if (!empty($userID)) {
             list($userName, $userEmail) = CRM_Contact_BAO_Contact_Location::getEmailDetails($userID);
             $values['receipt_from_email'] = CRM_Utils_Array::value('receipt_from_email', $input, $userEmail);
             $values['receipt_from_name'] = CRM_Utils_Array::value('receipt_from_name', $input, $userName);
         }
     }
     return $contribution->composeMessageArray($input, $ids, $values, $recur, $returnMessageText);
 }
开发者ID:nganivet,项目名称:civicrm-core,代码行数:38,代码来源:Contribution.php

示例3: sendMail

 /**
  * Send receipt from contribution.
  *
  * Do not call this directly - it is being refactored. use contribution.sendmessage api call.
  *
  * 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 CRM_Contribute_BAO_Contribution $contribution
  * @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 static function sendMail(&$input, &$ids, $contribution, &$values, $recur = FALSE, $returnMessageText = FALSE)
 {
     $input['is_recur'] = $recur;
     $input['receipt_date'] = $contribution->receipt_date;
     // set receipt from e-mail and name in value
     if (!$returnMessageText) {
         $session = CRM_Core_Session::singleton();
         $userID = $session->get('userID');
         if (!empty($userID)) {
             list($userName, $userEmail) = CRM_Contact_BAO_Contact_Location::getEmailDetails($userID);
             $values['receipt_from_email'] = CRM_Utils_Array::value('receipt_from_email', $input, $userEmail);
             $values['receipt_from_name'] = CRM_Utils_Array::value('receipt_from_name', $input, $userName);
         }
     }
     // Contribution ID should really always be set. But ?
     if (!$returnMessageText && (!isset($input['receipt_update']) || $input['receipt_update'])) {
         civicrm_api3('Contribution', 'create', array('receipt_date' => 'now', 'id' => $contribution->id));
     }
     return $contribution->composeMessageArray($input, $ids, $values, $recur, $returnMessageText);
 }
开发者ID:scardinius,项目名称:civicrm-core,代码行数:43,代码来源:Contribution.php


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