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


PHP comquick2cartHelper::sendmail方法代码示例

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


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

示例1: SendMailToAdminApproval

 function SendMailToAdminApproval($prod_values, $item_id, $newProduct = 1)
 {
     $loguser = JFactory::getUser();
     $comquick2cartHelper = new comquick2cartHelper();
     $app = JFactory::getApplication();
     $mailfrom = $app->getCfg('mailfrom');
     $fromname = $app->getCfg('fromname');
     $sitename = $app->getCfg('sitename');
     $params = JComponentHelper::getParams('com_quick2cart');
     $sendto = $params->get('sale_mail');
     $currency = $comquick2cartHelper->getCurrencySession();
     //$params->get('addcurrency');  // @sheha : currency should take from session instead of param
     //$sendto = $mailfrom;
     $multiple_img = array();
     $count = 0;
     $prod_imgs = $prod_values->get('qtc_prodImg', array(), "ARRAY");
     $quick2cartModelProduct = new quick2cartModelProduct();
     $multiple_img = $quick2cartModelProduct->getProdutImages($item_id);
     $body = '';
     // Edit product
     if ($newProduct == 0) {
         $subject = JText::_('COM_Q2C_EDIT_PRODUCT_SUBJECT');
         $subject = str_replace('{sellername}', $loguser->name, $subject);
         $body = JText::_('COM_Q2C_EDIT_PRODUCT_BODY');
         $body = str_replace('{productname}', $prod_values->get('item_name', '', 'RAW'), $body);
         $pod_price = $prod_values->get('multi_cur', array(), "ARRAY");
         $body = str_replace('{price}', $pod_price[$currency], $body);
         $body = str_replace('{sellername}', $loguser->name, $body);
         $body = str_replace('{sku}', $prod_values->get('sku', '', 'RAW'), $body);
         //~ for($i=0; $i < count($multiple_img); $i++)
         //~ {
         //~ print"<pre>"; print_r($multiple_img); die("222882");
         //~ $body	.= '<br><img src="' . JUri::root() . 'images/quick2cart/' . $multiple_img[$i] . '" alt="No image" ><br>';
         //~ }
         if (!empty($multiple_img)) {
             $multiple_img = (array) $multiple_img;
             foreach ($multiple_img as $key => $img) {
                 $body .= '<br><img src="' . JUri::root() . 'images/quick2cart/' . $img[$key] . '" alt="No image" ><br>';
             }
         }
     } else {
         $subject = JText::_('COM_Q2C_PRODUCT_AAPROVAL_SUBJECT');
         $body = JText::_('COM_Q2C_PRODUCT_AAPROVAL_BODY');
         $body = str_replace('{title}', $prod_values->get('item_name', '', 'RAW'), $body);
         $body = str_replace('{sellername}', $loguser->name, $body);
         $desc = $prod_values->get('description', '', 'ARRAY');
         $desc = strip_tags(trim($desc['data']));
         $body = str_replace('{des}', $desc, $body);
         $body = str_replace('{link}', JUri::base() . 'administrator/index.php?option=com_quick2cart&view=products&filter_published=0', $body);
         for ($i = 0; $i < count($multiple_img); $i++) {
             $body .= '<br><img src="' . JUri::ROOT() . 'images/quick2cart/' . $multiple_img[$i] . '" alt="No image" ><br>';
         }
     }
     $res = $comquick2cartHelper->sendmail($mailfrom, $subject, $body, $sendto);
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:55,代码来源:product.php

示例2: SendMailOwnerOnCreateStore

 function SendMailOwnerOnCreateStore($store)
 {
     $lang = JFactory::getLanguage();
     $lang->load('com_quick2cart', JPATH_SITE);
     $app = JFactory::getApplication();
     $sitename = $app->getCfg('sitename');
     $sendto = $store->store_email;
     $params = JComponentHelper::getParams('com_quick2cart');
     $admin_approval_stores = $params->get("admin_approval_stores", 0);
     if ($admin_approval_stores == 1) {
         $subject = JText::_('COM_QUICK2CART_STORE_APPROVAL_OWNER_SUBJECT');
         $body = JText::_('COM_QUICK2CART_STORE_APPROVAL_OWNER_BODY');
     } else {
         $subject = JText::_('COM_QUICK2CART_STORE_OWNER_NORMAL_MAIL_SUB');
         $body = JText::_('COM_QUICK2CART_STORE_OWNER_NORMAL_MAIL_BODY');
     }
     $subject = str_replace('{store_name}', $store->item_name, $subject);
     $subject = str_replace('{sitename}', $sitename, $subject);
     $body = str_replace('{title}', $store->title, $body);
     $body = str_replace('{description}', $store->description, $body);
     $body = str_replace('{sitename}', $sitename, $body);
     $comquick2cartHelper = new comquick2cartHelper();
     $res = $comquick2cartHelper->sendmail($sendto, $subject, $body);
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:24,代码来源:vendor.php

示例3: SendMailToOwnerAfterApproval

 function SendMailToOwnerAfterApproval($owner)
 {
     $comquick2cartHelper = new comquick2cartHelper();
     $itemid = $comquick2cartHelper->getItemId('index.php?option=com_quick2cart&view=category&layout=default');
     $app = JFactory::getApplication();
     $fromname = $app->getCfg('fromname');
     $sitename = $app->getCfg('sitename');
     $subject = JText::_('COM_Q2C_PRODUCT_AAPROVED_SUBJECT');
     $subject = str_replace('{sellername}', $owner->name, $subject);
     $body = JText::_('COM_Q2C_PRODUCT_APPROVED_BODY');
     $body = str_replace('{name}', $owner->name, $body);
     $body = str_replace('{admin}', $fromname, $body);
     $body = str_replace('{link}', JUri::root() . 'index.php?option=com_quick2cart&view=category&layout=default&Itemid=' . $itemid, $body);
     $body = str_replace('{sitelink}', JUri::root(), $body);
     $body = str_replace('{sitename}', $sitename, $body);
     $res = $comquick2cartHelper->sendmail($owner->email, $subject, $body);
     return $res;
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:18,代码来源:product.php

示例4: updatestatus


//.........这里部分代码省略.........
     $result = $dispatcher->trigger('Onq2cOrderUpdate', array($orderobj));
     //Call the plugin and get the result
     //END Q2C Sample development
     if ($send_mail == 1 && $order_oldstatus != $status) {
         $params = JComponentHelper::getParams('com_quick2cart');
         //$adminemails = comquick2cartHelper::adminMails();
         $query = "SELECT ou.user_id,ou.user_email,ou.firstname FROM #__kart_users as ou WHERE ou.address_type='BT' AND ou.order_id = " . $order_id;
         $db->setQuery($query);
         $orderuser = $db->loadObjectList();
         //Change for backward compatiblity for user info not saving order id against it
         if (empty($orderuser)) {
             $query = "SELECT ou.user_id,ou.user_email,ou.firstname\n\t\t\t\tFROM #__kart_users as ou \n\t\t\t\tWHERE ou.address_type='BT' AND ou.order_id IS NULL AND ou.user_id = (SELECT o.user_info_id FROM #__kart_orders as o WHERE o.id =" . $order_id . ")";
             $db->setQuery($query);
             $orderuser = $db->loadObjectList();
         }
         $orderuser = $orderuser[0];
         switch ($status) {
             case 'C':
                 $orderstatus = JText::_('QTC_CONFR');
                 /*for invoice*/
                 $jinput = JFactory::getApplication()->input;
                 $jinput->set('orderid', $order_id);
                 $order = $order_bk = $comquick2cartHelper->getorderinfo($order_id);
                 $this->orderinfo = $order['order_info'];
                 $this->orderitems = $order['items'];
                 $this->orders_site = 1;
                 $this->orders_email = 1;
                 $this->order_authorized = 1;
                 if ($this->orderinfo[0]->address_type == 'BT') {
                     $billemail = $this->orderinfo[0]->user_email;
                 } else {
                     if ($this->orderinfo[1]->address_type == 'BT') {
                         $billemail = $this->orderinfo[1]->user_email;
                     }
                 }
                 $fullorder_id = $order['order_info'][0]->prefix . $order_id;
                 if (!JFactory::getUser()->id && $params->get('guest')) {
                     $jinput->set('email', md5($billemail));
                 }
                 // check for view override
                 $view = $comquick2cartHelper->getViewpath('orders', 'invoice');
                 ob_start();
                 include $view;
                 $invoicehtml = ob_get_contents();
                 ob_end_clean();
                 /*for invoice*/
                 break;
             case 'RF':
                 $orderstatus = JText::_('QTC_REFUN');
                 break;
             case 'S':
                 $orderstatus = JText::_('QTC_SHIP');
                 break;
             case 'E':
                 $orderstatus = JText::_('QTC_ERR');
                 break;
             case 'P':
                 $orderstatus = JText::_('QTC_PENDIN');
                 break;
             default:
                 $orderstatus = $status;
                 break;
         }
         $fullorder_id = $orderobj->prefix . $order_id;
         if (!empty($store_id)) {
             $productStatus = $comquick2cartHelper->getProductStatus($order_id);
             $body = JText::sprintf('QTC_STORE_PRODUCT_STATUS_CHANGE_BODY', $productStatus);
         } else {
             $body = JText::_('QTC_STATUS_CHANGE_BODY');
         }
         $site = $mainframe->getCfg('sitename');
         if ($comment) {
             $comment = str_replace('{COMMENT}', $comment, JText::_('QTC_COMMENT_TEXT'));
             $find = array('{ORDERNO}', '{STATUS}', '{SITENAME}', '{NAME}', '{COMMENTTEXT}');
             $replace = array($fullorder_id, $orderstatus, $site, $orderuser->firstname, $comment);
         } else {
             $find = array('{ORDERNO}', '{STATUS}', '{SITENAME}', '{NAME}', '{COMMENTTEXT}');
             $replace = array($fullorder_id, $orderstatus, $site, $orderuser->firstname, '');
         }
         $body = str_replace($find, $replace, $body);
         $guest_email = '';
         if (!$orderuser->user_id && $params->get('guest')) {
             $guest_email = "&email=" . md5($orderuser->user_email);
         }
         $Itemid = $comquick2cartHelper->getitemid('index.php?option=com_quick2cart&view=orders');
         $link = JURI::root() . substr(JRoute::_('index.php?option=com_quick2cart&view=orders&layout=order' . $guest_email . '&orderid=' . $order_id . '&Itemid=' . $Itemid), strlen(JURI::base(true)) + 1);
         $order_link = '<a href="' . $link . '">' . JText::_('QTC_ORDER_GUEST_LINK') . '</a>';
         $body = str_replace('{LINK}', $order_link, $body);
         $body = nl2br($body);
         if (!empty($invoicehtml)) {
             $body = $body . '<div>' . JText::_('QTC_ORDER_INVOICE_IN_MAIL') . '</div>';
             $invoicehtml = $body . $invoicehtml;
             $invoicesubject = JText::sprintf('QTC_INVOICE_MAIL_SUB', $site, $fullorder_id);
             $comquick2cartHelper->sendmail($orderuser->user_email, $invoicesubject, $invoicehtml, $params->get('sale_mail'));
         } else {
             $subject = JText::sprintf('QTC_STATUS_CHANGE_SUBJECT', $fullorder_id);
             $comquick2cartHelper->sendmail($orderuser->user_email, $subject, $body, $params->get('sale_mail'));
         }
     }
 }
开发者ID:muratgoktuna,项目名称:joomla-payments,代码行数:101,代码来源:tjcpg.php

示例5: sendInvoice


//.........这里部分代码省略.........
  * @param   STRING   $comment    comment
  * @param   INTEGER  $send_mail  send_mail
  * @param   INTEGER  $store_id   store_id
  *
  * @return  boolean
  */
 public function sendInvoice($order_id, $status, $comment = '', $send_mail = 1, $store_id = 0)
 {
     $mainframe = JFactory::getApplication();
     $db = JFactory::getDBO();
     $params = JComponentHelper::getParams('com_quick2cart');
     $comquick2cartHelper = new comquick2cartHelper();
     // Load language file as require from backend add product.
     JFactory::getLanguage()->load('com_quick2cart', JPATH_SITE);
     // START Q2C Sample development
     $query = "SELECT o.* FROM #__kart_orders as o WHERE o.id =" . $order_id;
     $db->setQuery($query);
     $orderobj = $db->loadObject();
     // $adminemails = comquick2cartHelper::adminMails();
     $query = "SELECT ou.user_id,ou.user_email,ou.firstname FROM #__kart_users as ou WHERE ou.address_type='BT' AND ou.order_id = " . $order_id;
     $db->setQuery($query);
     $orderuser = $db->loadObjectList();
     // Change for backward compatiblity for user info not saving order id against it
     if (empty($orderuser)) {
         $query = "SELECT ou.user_id,ou.user_email,ou.firstname\n\t\tFROM #__kart_users as ou\n\t\tWHERE ou.address_type='BT' AND ou.order_id IS NULL AND ou.user_id = (SELECT o.user_info_id FROM #__kart_orders as o WHERE o.id =" . $order_id . ")";
         $db->setQuery($query);
         $orderuser = $db->loadObjectList();
     }
     $orderuser = $orderuser[0];
     $jinput = JFactory::getApplication()->input;
     $jinput->set('orderid', $order_id);
     $order = $order_bk = $comquick2cartHelper->getorderinfo($order_id);
     $this->orderinfo = $order['order_info'];
     $this->orderitems = $order['items'];
     $this->orders_site = 1;
     $this->orders_email = 1;
     $this->order_authorized = 1;
     if ($this->orderinfo[0]->address_type == 'BT') {
         $billemail = $this->orderinfo[0]->user_email;
     } elseif ($this->orderinfo[1]->address_type == 'BT') {
         $billemail = $this->orderinfo[1]->user_email;
     }
     $fullorder_id = $order['order_info'][0]->prefix . $order_id;
     if (!JFactory::getUser()->id && $params->get('guest')) {
         $jinput->set('email', md5($billemail));
         $this->calledFromOnePageCkout = 1;
     }
     // Check for view override
     $view = $comquick2cartHelper->getViewpath('orders', 'invoice');
     ob_start();
     include $view;
     $invoicehtml = ob_get_contents();
     ob_end_clean();
     $fullorder_id = $orderobj->prefix . $order_id;
     if (!empty($store_id)) {
         $productStatus = $comquick2cartHelper->getProductStatus($order_id);
         $body = JText::sprintf('QTC_STORE_PRODUCT_STATUS_CHANGE_BODY', $productStatus);
     } else {
         $body = JText::_('COM_QUICK2CART_INVOICE_BODY');
     }
     $site = $mainframe->getCfg('sitename');
     if ($comment) {
         $comment = str_replace('{COMMENT}', $comment, JText::_('QTC_COMMENT_TEXT'));
         $find = array('{ORDERNO}', '{STATUS}', '{SITENAME}', '{NAME}', '{COMMENTTEXT}');
         $replace = array($fullorder_id, JText::_('QTC_CONFR'), $site, $orderuser->firstname, $comment);
     } else {
         $find = array('{ORDERNO}', '{STATUS}', '{SITENAME}', '{NAME}', '{COMMENTTEXT}');
         $replace = array($fullorder_id, JText::_('QTC_CONFR'), $site, $orderuser->firstname, '');
     }
     $body = str_replace($find, $replace, $body);
     $guest_email = '';
     if (!$orderuser->user_id && $params->get('guest')) {
         $guest_email = "&email=" . md5($orderuser->user_email);
     }
     $Itemid = $comquick2cartHelper->getitemid('index.php?option=com_quick2cart&view=orders');
     $tempLink = JRoute::_('index.php?option=com_quick2cart&view=orders&layout=order' . $guest_email . '&orderid=' . $order_id . '&Itemid=' . $Itemid);
     $link = JUri::root() . substr($tempLink, strlen(JUri::base(true)) + 1);
     $order_link = '<a href="' . $link . '">' . JText::_('QTC_ORDER_GUEST_LINK') . '</a>';
     $body = str_replace('{LINK}', $order_link, $body);
     $body = nl2br($body);
     // GETTING BODY AND MAIL SUBJECT
     if (!empty($invoicehtml)) {
         $body = $body . '<div>' . JText::_('QTC_ORDER_INVOICE_IN_MAIL') . '</div>';
         $body = $body . $invoicehtml;
         $subject = JText::sprintf('QTC_INVOICE_MAIL_SUB', $site, $fullorder_id);
     } else {
         $subject = JText::sprintf('QTC_STATUS_CHANGE_SUBJECT', $fullorder_id);
     }
     // Call the plugin and get the result
     $dispatcher = JDispatcher::getInstance();
     JPluginHelper::importPlugin('system');
     $result = $dispatcher->trigger('OnBeforeq2cOrderUpdateEmail', array($orderobj, $subject, $body));
     if (!empty($result[0])) {
         $subject = $result[0][0];
         $body = $result[0][1];
     }
     //print $body; die;
     // Send mail
     $comquick2cartHelper->sendmail($orderuser->user_email, $subject, $body, $params->get('sale_mail'));
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:101,代码来源:helper.php

示例6: sendMailToOwnerOnStoreApproval

 function sendMailToOwnerOnStoreApproval($store)
 {
     $app = JFactory::getApplication();
     $sitename = $app->getCfg('sitename');
     $subject = JText::_('COM_QUICK2CART_STORE_APPROVED_SUBJECT');
     $subject = str_replace('{storename}', $store->title, $subject);
     $subject = str_replace('{sitename}', $sitename, $subject);
     $body = JText::_('COM_QUICK2CART_STORE_APPROVED_BODY');
     $body = str_replace('{sitename}', $sitename, $body);
     $body = str_replace('{storename}', $store->title, $body);
     $comquick2cartHelper = new comquick2cartHelper();
     $result = $comquick2cartHelper->sendmail($store->store_email, $subject, $body);
     return $result;
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:14,代码来源:store.php


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