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


PHP Sites::getValues方法代码示例

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


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

示例1: Emails

 function Emails($transaction = false, $dump = false)
 {
     if ($transaction) {
         global $_CONF;
         loadclass('Transactions');
         loadclass('Sites');
         loadclass('Merchants');
         loadclass('MerchantAccounts');
         loadclass('Customers');
         loadclass('EmailSettings');
         $customer = new Customers($transaction->transactionCustomerID);
         $merchant = new Merchants($transaction->transactionMerchantID);
         //if(!($_CONF[mail_enabled]!='FALSE' && $merchant->merchantEmailSending==1)) return false;
         $merchantaccount = new MerchantAccounts($merchant->merchantMerchantAccountID);
         $site = new Sites($transaction->transactionSiteID);
         $order = unserialize($customer->customerOrderObject);
         $emailSettings = new EmailSettings($merchant->merchantEmailSettingID);
         $smarty = new Smarty();
         $smarty->assign($transaction->getValues());
         $smarty->assign($customer->getValues());
         $smarty->assign($merchant->getValues());
         $smarty->assign($merchantaccount->getValues());
         $smarty->assign($emailSettings->getValues());
         $smarty->assign($site->getValues());
         $smarty->assign($order);
         $smarty->assign('Order', $order);
         if (!empty($emailSettings->emailFromEmail)) {
             $from = "{$emailSettings->emailCompanyName} <{$emailSettings->emailFromEmail}>";
         }
         $recipients[] = $customer->customerEmail;
         if ($site->siteEmailSendCustomerService) {
             $recipients[] = $site->siteCustomerSupportEmail;
         }
         if ($site->siteEmailSendAdditionalRecipients) {
             $recipients[] = $site->siteEmailAdditionalRecipients;
         }
         $smarty->assign('mheaders', $emailSettings->emailHeaders);
         $emails_dir = $_CONF[root_dir] . $_CONF[emails_dir];
         if (is_dir($emails_dir . "/merchant_emails/" . $merchant->getID())) {
             $emails_dir = $emails_dir . "/merchant_emails/" . $merchant->getID() . "/";
         }
         switch ($transaction->transactionType) {
             case 'rebill':
                 if ($transaction->transactionStatus == 'approved' || $transaction->transactionStatus == 'test' && $transaction->transactionReturnNumber == 'AUTH_TESTCARD_APP') {
                     $subject = $emailSettings->emailPaymentSubject;
                     $smarty->assign('msubject', $subject);
                     if (!$site->siteRebillEmailTemplate) {
                         $site->siteRebillEmailTemplate = $_CONF[emails_rebill];
                     }
                     $out = $smarty->fetch($emails_dir . $site->siteRebillEmailTemplate);
                 } else {
                     return false;
                     // $out=$smarty->fetch($_CONF[root_dir].$_CONF[emails_dir].$_CONF[emails_rebill]);
                 }
                 break;
             case 'sale':
                 if ($transaction->transactionStatus == 'approved' || $transaction->transactionStatus == 'test' && $transaction->transactionReturnNumber == 'AUTH_TESTCARD_APP') {
                     $subject = $emailSettings->emailPaymentSubject;
                     $smarty->assign('msubject', $subject);
                     if (!$site->sitePaymentEmailTemplate) {
                         $site->sitePaymentEmailTemplate = $_CONF[emails_payment];
                     }
                     $out = $smarty->fetch($emails_dir . $site->sitePaymentEmailTemplate);
                 } else {
                     return false;
                     //$out=$smarty->fetch($_CONF[root_dir].$_CONF[emails_dir].$_CONF[emails_payment]);
                 }
                 break;
             case 'chargeback':
                 $out = $smarty->fetch($emails_dir . $_CONF[emails_chargeback]);
                 break;
             case 'refund':
                 $out = $smarty->fetch($emails_dir . $_CONF[emails_refund]);
                 break;
             case 'reversal':
                 $out = $smarty->fetch($emails_dir . $_CONF[emails_reversal]);
                 break;
         }
         $body = $smarty->getSmartyVar('capture.body');
         $subject = $smarty->getSmartyVar('capture.subject');
         $headers = array();
         if ($add_h = explode("\n", $smarty->getSmartyVar('capture.headers'))) {
             $headers = array_merge($headers, $add_h);
         }
         if ($dump) {
             mydump($body);
             mydump($subject);
             mydump($headers);
             mydump($recipients);
             exit;
         }
         if ($_CONF[mail_enabled] != 'FALSE' && $merchant->merchantEmailSending == 1) {
             return pmail($recipients, $body, $subject, $headers, $from);
         }
     }
 }
开发者ID:alex-k,项目名称:velotur,代码行数:96,代码来源:Emails_class.php


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