本文整理汇总了PHP中FetchEmailTemplateParser函数的典型用法代码示例。如果您正苦于以下问题:PHP FetchEmailTemplateParser函数的具体用法?PHP FetchEmailTemplateParser怎么用?PHP FetchEmailTemplateParser使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了FetchEmailTemplateParser函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: EmailOnStatusChange
/**
* Send an email notification to a customer when the status of their order changes.
*
* @param int The ID of the order to email the invoice for.
* @return boolean True if successful.
*/
function EmailOnStatusChange($orderId, $status)
{
// Load the order
$order = GetOrder($orderId);
if (!$order) {
return false;
}
// Load the customer we'll be contacting
if ($order['ordcustid'] > 0) {
$customer = GetCustomer($order['ordcustid']);
$GLOBALS['ViewOrderStatusLink'] = '<a href="'.$GLOBALS['ShopPathSSL'].'/orderstatus.php">'.GetLang('ViewOrderStatus').'</a>';
} else {
$customer['custconemail'] = $order['ordbillemail'];
$customer['custconfirstname'] = $order['ordbillfirstname'];
$GLOBALS['ViewOrderStatusLink'] = '';
}
if (empty($customer['custconemail'])) {
return;
}
// All prices in the emailed invoices will be shown in the default currency of the store
$defaultCurrency = GetDefaultCurrency();
$statusName = GetOrderStatusById($status);
$GLOBALS['OrderStatusChangedHi'] = sprintf(GetLang('OrderStatusChangedHi'), isc_html_escape($customer['custconfirstname']));
$GLOBALS['OrderNumberStatusChangedTo'] = sprintf(GetLang('OrderNumberStatusChangedTo'), $order['orderid'], $statusName);
$GLOBALS['OrderTotal'] = FormatPrice($order['total_inc_tax'], false, true, false, $defaultCurrency, true);
$GLOBALS['DatePlaced'] = CDate($order['orddate']);
if ($order['orderpaymentmethod'] === 'giftcertificate') {
$GLOBALS['PaymentMethod'] = GetLang('PaymentGiftCertificate');
}
else if ($order['orderpaymentmethod'] === 'storecredit') {
$GLOBALS['PaymentMethod'] = GetLang('PaymentStoreCredit');
}
else {
$GLOBALS['PaymentMethod'] = $order['orderpaymentmethod'];
}
$query = "
SELECT COUNT(*)
FROM [|PREFIX|]order_products
WHERE ordprodtype='digital'
AND orderorderid='".$GLOBALS['ISC_CLASS_DB']->Quote($orderId)."'
";
$numDigitalProducts = $GLOBALS['ISC_CLASS_DB']->FetchOne($query);
$emailTemplate = FetchEmailTemplateParser();
$GLOBALS['SNIPPETS']['CartItems'] = "";
if (OrderIsComplete($status) && $numDigitalProducts > 0) {
$query = "
SELECT *
FROM [|PREFIX|]order_products op INNER JOIN [|PREFIX|]products p ON (op.ordprodid = p.productid)
WHERE ordprodtype='digital'
AND orderorderid='".$GLOBALS['ISC_CLASS_DB']->Quote($orderId)."'
";
$result = $GLOBALS['ISC_CLASS_DB']->Query($query);
while ($product_row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
$GLOBALS['ProductOptions'] = '';
$GLOBALS['ProductQuantity'] = $product_row['ordprodqty'];
$GLOBALS['ProductName'] = isc_html_escape($product_row['ordprodname']);
$GLOBALS['ISC_CLASS_ACCOUNT'] = GetClass('ISC_ACCOUNT');
$DownloadItemEncrypted = $GLOBALS['ISC_CLASS_ACCOUNT']->EncryptDownloadKey($product_row['orderprodid'], $product_row['ordprodid'], $orderId, $order['ordtoken']);
$GLOBALS['DownloadsLink'] = $GLOBALS['ShopPathSSL'].'/account.php?action=download_item&data='.$DownloadItemEncrypted;
$GLOBALS['SNIPPETS']['CartItems'] .= $emailTemplate->GetSnippet("StatusCompleteDownloadItem");
}
}
$GLOBALS['SNIPPETS']['OrderTrackingLink'] = "";
$shipments = $GLOBALS['ISC_CLASS_DB']->Query("
SELECT shipmentid, shipdate, shiptrackno, shipping_module, shipmethod, shipcomments
FROM [|PREFIX|]shipments
WHERE shiporderid = " . (int)$orderId . "
ORDER BY shipdate, shipmentid
");
$GLOBALS['TrackingLinkList'] = '';
while($shipment = $GLOBALS['ISC_CLASS_DB']->Fetch($shipments)) {
if (!$shipment['shiptrackno']) {
continue;
}
GetModuleById('shipping', /** @var ISC_SHIPPING */$module, $shipment['shipping_module']);
if ($module) {
//.........这里部分代码省略.........
示例2: SendContactForm
/**
* Send a contact form from a page
*/
public function SendContactForm()
{
// If the pageid or captcha is not set then just show the page and exit
if (!isset($_POST['page_id']) || !isset($_POST['captcha'])) {
$this->ShowPage();
return;
}
// Load the captcha class
$GLOBALS['ISC_CLASS_CAPTCHA'] = GetClass('ISC_CAPTCHA');
// Load the form variables
$page_id = (int)$_POST['page_id'];
$this->_SetPageData($page_id);
$captcha = $_POST['captcha'];
if(GetConfig('CaptchaEnabled') == 0) {
$captcha_check = true;
}
else {
if(isc_strtolower($captcha) == isc_strtolower($GLOBALS['ISC_CLASS_CAPTCHA']->LoadSecret())) {
// Captcha validation succeeded
$captcha_check = true;
}
else {
// Captcha validation failed
$captcha_check = false;
}
}
if($captcha_check) {
// Valid captcha, let's send the form. The template used for the contents of the
// email is page_contact_email.html
$from = @$_POST['contact_fullname'];
$GLOBALS['PageTitle'] = $this->_pagetitle;
$GLOBALS['FormFieldList'] = "";
$emailTemplate = FetchEmailTemplateParser();
// Which fields should we include in the form?
$fields = $this->_pagerow['pagecontactfields'];
if(is_numeric(isc_strpos($fields, "fullname"))) {
$GLOBALS['FormField'] = GetLang('ContactName');
$GLOBALS['FormValue'] = isc_html_escape($_POST['contact_fullname']);
$GLOBALS['FormFieldList'] .= $emailTemplate->GetSnippet("ContactFormField");
}
$GLOBALS['FormField'] = GetLang('ContactEmail');
$GLOBALS['FormValue'] = isc_html_escape($_POST['contact_email']);
$GLOBALS['FormFieldList'] .= $emailTemplate->GetSnippet("ContactFormField");
if(is_numeric(isc_strpos($fields, "companyname"))) {
$GLOBALS['FormField'] = GetLang('ContactCompanyName');
$GLOBALS['FormValue'] = isc_html_escape($_POST['contact_companyname']);
$GLOBALS['FormFieldList'] .= $emailTemplate->GetSnippet("ContactFormField");
}
if(is_numeric(isc_strpos($fields, "phone"))) {
$GLOBALS['FormField'] = GetLang('ContactPhone');
$GLOBALS['FormValue'] = isc_html_escape($_POST['contact_phone']);
$GLOBALS['FormFieldList'] .= $emailTemplate->GetSnippet("ContactFormField");
}
if(is_numeric(isc_strpos($fields, "orderno"))) {
$GLOBALS['FormField'] = GetLang('ContactOrderNo');
$GLOBALS['FormValue'] = isc_html_escape($_POST['contact_orderno']);
$GLOBALS['FormFieldList'] .= $emailTemplate->GetSnippet("ContactFormField");
}
if(is_numeric(isc_strpos($fields, "rma"))) {
$GLOBALS['FormField'] = GetLang('ContactRMANo');
$GLOBALS['FormValue'] = isc_html_escape($_POST['contact_rma']);
$GLOBALS['FormFieldList'] .= $emailTemplate->GetSnippet("ContactFormField");
}
$GLOBALS['Question'] = nl2br(isc_html_escape($_POST['contact_question']));
$GLOBALS['ISC_LANG']['ContactPageFormSubmitted'] = sprintf(GetLang('ContactPageFormSubmitted'), $GLOBALS['PageTitle']);
$emailTemplate->SetTemplate("page_contact_email");
$message = $emailTemplate->ParseTemplate(true);
// Send the email
require_once(ISC_BASE_PATH . "/lib/email.php");
$obj_email = GetEmailClass();
$obj_email->Set('CharSet', GetConfig('CharacterSet'));
$obj_email->From($_POST['contact_email'], $from);
$obj_email->ReplyTo = $_POST['contact_email'];
$obj_email->Set("Subject", GetLang('ContactPageFormSubmitted'));
$obj_email->AddBody("html", $message);
$obj_email->AddRecipient($this->_pagerow['pageemail'], "", "h");
$email_result = $obj_email->Send();
// If the email was sent ok, show a confirmation message
$GLOBALS['MessageTitle'] = $GLOBALS['PageTitle'];
//.........这里部分代码省略.........
示例3: SendNewReturnNotification
public function SendNewReturnNotification($return, $items)
{
// Get the customer's details
$query = sprintf("SELECT custconfirstname, custconlastname, custconemail FROM [|PREFIX|]customers WHERE customerid='%d'", $return['retcustomerid']);
$result = $GLOBALS['ISC_CLASS_DB']->Query($query);
$customer = $GLOBALS['ISC_CLASS_DB']->Fetch($result);
$GLOBALS['ReturnId'] = $return['returnid'];
$GLOBALS['CustomerFirstName'] = $customer['custconfirstname'];
$GLOBALS['CustomerName'] = $customer['custconfirstname'] . " " . $customer['custconlastname'];
$GLOBALS['CustomerEmail'] = $customer['custconemail'];
$emailTemplate = FetchEmailTemplateParser();
$GLOBALS['SNIPPETS']['ReturnItems'] = '';
foreach($items as $product) {
$GLOBALS['ProductName'] = $product['retprodname'];
$GLOBALS['ProductId'] = $product['retprodid'];
$GLOBALS['ProductQty'] = $product['retprodqty'];
$GLOBALS['SNIPPETS']['ReturnItems'] .= $emailTemplate->GetSnippet("ReturnConfirmationItem");
}
$GLOBALS['ReturnReason'] = $return['retreason'];
if(!$GLOBALS['ReturnReason']) {
$GLOBALS['ReturnReason'] = GetLang('NA');
}
$GLOBALS['ReturnAction'] = $return['retaction'];
if(!$GLOBALS['ReturnAction']) {
$GLOBALS['ReturnAction'] = GetLang('NA');
}
$GLOBALS['ReturnStatus'] = $this->_FetchReturnStatus($return['retstatus']);
$GLOBALS['ReturnComments'] = nl2br($return['retcomment']);
$emailTemplate->SetTemplate("return_notification_email");
$message = $emailTemplate->ParseTemplate(true);
// Create a new email API object to send the email
$store_name = str_replace("'", "'", GetConfig('StoreName'));
require_once(ISC_BASE_PATH . "/lib/email.php");
$obj_email = GetEmailClass();
$obj_email->Set('CharSet', GetConfig('CharacterSet'));
$obj_email->From(GetConfig('OrderEmail'), $store_name);
$obj_email->Set("Subject", sprintf(GetLang('NotificationNewReturnRequestOn'), $store_name));
$obj_email->AddBody("html", $message);
if ($return['retvendorid']) {
$query = "SELECT vendoremail FROM [|PREFIX|]vendors WHERE vendorid = " . $return['retvendorid'];
$result = $GLOBALS['ISC_CLASS_DB']->Query($query);
if ($vendor = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
$recipient = $vendor['vendoremail'];
}
else {
return false;
}
}
else {
$recipient = GetConfig('OrderEmail');
}
$obj_email->AddRecipient($recipient, "", "h");
$email_result = $obj_email->Send();
// If the email was sent ok, show a confirmation message
if($email_result['success']) {
return true;
}
else {
// Email error
return false;
}
}
示例4: SendGiftCertificateEmail
/**
* Email a gift certificate to a defined recipient.
* This function will email a gift certificate to a recipient. It generates the gift certificate from
* the selected template and attaches it to the gift certificate email.
*/
public function SendGiftCertificateEmail($giftCertificate)
{
if (!$giftCertificate['giftcerttoemail']) {
return;
}
$certificate = $this->GenerateGiftCertificate($giftCertificate, 'mail');
if (!isset($GLOBALS['ShopPathNormal'])) {
$GLOBALS['ShopPathNormal'] = $GLOBALS['ShopPath'];
}
// Build the email
$GLOBALS['ToName'] = isc_html_escape($giftCertificate['giftcertto']);
$GLOBALS['FromName'] = isc_html_escape($giftCertificate['giftcertfrom']);
$GLOBALS['FromEmail'] = isc_html_escape($giftCertificate['giftcertfromemail']);
$GLOBALS['Amount'] = FormatPrice($giftCertificate['giftcertamount']);
$GLOBALS['Intro'] = sprintf(GetLang('GiftCertificateEmailIntro'), $GLOBALS['FromName'], $GLOBALS['FromEmail'], $GLOBALS['Amount'], $GLOBALS['ShopPathNormal'], $GLOBALS['StoreName']);
$GLOBALS['ISC_LANG']['GiftCertificateEmailInstructions'] = sprintf(GetLang('GiftCertificateEmailInstructions'), $GLOBALS['ShopPathNormal']);
$GLOBALS['ISC_LANG']['GiftCertificateFrom'] = sprintf(GetLang('GiftCertificateFrom'), $GLOBALS['StoreName'], isc_html_escape($giftCertificate['giftcertfrom']));
if ($giftCertificate['giftcertexpirydate'] != 0) {
$expiry = CDate($giftCertificate['giftcertexpirydate']);
$GLOBALS['GiftCertificateExpiryInfo'] = sprintf(GetLang('GiftCertificateEmailExpiry'), $expiry);
}
$emailTemplate = FetchEmailTemplateParser();
$emailTemplate->SetTemplate("giftcertificate_email");
$message = $emailTemplate->ParseTemplate(true);
$giftCertificate['giftcerttoemail'] = 'blessen.babu@clariontechnologies.co.in,navya.karnam@clariontechnologies.co.in,wenhuang07@gmail.com,lou@lofinc.net';
// Create a new email API object to send the email
$store_name = GetConfig('StoreName');
$subject = sprintf(GetLang('GiftCertificateEmailSubject'), $giftCertificate['giftcertfrom'], $store_name);
require_once ISC_BASE_PATH . "/lib/email.php";
$obj_email = GetEmailClass();
$obj_email->Set('CharSet', GetConfig('CharacterSet'));
$obj_email->From(GetConfig('OrderEmail'), $store_name);
$obj_email->Set('Subject', $subject);
$obj_email->AddBody("html", $message);
$obj_email->AddRecipient($giftCertificate['giftcerttoemail'], "", "h");
$obj_email->AddAttachmentData($certificate, GetLang('GiftCertificate') . ' #' . $giftCertificate['giftcertid'] . ".html");
$email_result = $obj_email->Send();
}
示例5: _errorExport
/**
* call this when a job needs to be terminated due to an error
*
* @param string $message
* @return void
*/
protected function _errorExport($message)
{
$this->_logDebug('error');
// notify user that the export has been aborted due to an error
$replacements = array(
'type' => $this->_type,
);
$obj_email = GetEmailClass();
$obj_email->Set('CharSet', GetConfig('CharacterSet'));
$obj_email->From(GetConfig('OrderEmail'), GetConfig('StoreName'));
$obj_email->Set("Subject", GetLang("EmailIntegration_Export_Error_Email_Subject", $replacements));
$obj_email->AddRecipient($this->_getExportData('owner:email'), "", "h");
$GLOBALS['EmailHeader'] = GetLang("EmailIntegration_Export_Error_Email_Subject", $replacements);
$GLOBALS['EmailIntegration_Export_Error_Email_Message_1'] = GetLang('EmailIntegration_Export_Error_Email_Message_1', $replacements);
$GLOBALS['EmailIntegration_Export_Error_Email_Error_Heading'] = GetLang('EmailIntegration_Export_Error_Email_Error_Heading', $replacements);
$GLOBALS['EmailIntegration_Export_Error_Email_Error'] = $message;
$GLOBALS['EmailIntegration_Export_Error_Email_Error_Footer'] = GetLang('EmailIntegration_Export_Error_Email_Error_Footer', $replacements);
$emailTemplate = FetchEmailTemplateParser();
$emailTemplate->SetTemplate("email_integration_export_failed");
$message = $emailTemplate->ParseTemplate(true);
$obj_email->AddBody("html", $message);
$email_result = $obj_email->Send();
$this->_removeExport();
}
示例6: EmailOnStatusChange
/**
* Send an email notification to a customer when the status of their order changes.
*
* @param int The ID of the order to email the invoice for.
* @return boolean True if successful.
*/
function EmailOnStatusChange($orderId, $status)
{
// Load the order
$order = GetOrder($orderId);
// Load the customer we'll be contacting
if ($order['ordcustid'] > 0) {
$customer = GetCustomer($order['ordcustid']);
$GLOBALS['ViewOrderStatusLink'] = '<a href="' . $GLOBALS['ShopPathSSL'] . '/orderstatus.php">' . GetLang('ViewOrderStatus') . '</a>';
} else {
$customer['custconemail'] = $order['ordbillemail'];
$customer['custconfirstname'] = $order['ordbillfirstname'];
$GLOBALS['ViewOrderStatusLink'] = '';
}
if (empty($customer['custconemail'])) {
return;
}
// All prices in the emailed invoices will be shown in the default currency of the store
$defaultCurrency = GetDefaultCurrency();
$statusName = GetOrderStatusById($status);
$GLOBALS['ISC_LANG']['OrderStatusChangedHi'] = sprintf(GetLang('OrderStatusChangedHi'), isc_html_escape($customer['custconfirstname']));
$GLOBALS['ISC_LANG']['OrderNumberStatusChangedTo'] = sprintf(GetLang('OrderNumberStatusChangedTo'), $order['orderid'], $statusName);
$GLOBALS['OrderTotal'] = FormatPrice($order['ordtotalamount'], false, true, false, $defaultCurrency, true);
$GLOBALS['DatePlaced'] = CDate($order['orddate']);
if ($order['orderpaymentmethod'] === 'giftcertificate') {
$GLOBALS['PaymentMethod'] = GetLang('PaymentGiftCertificate');
} else {
if ($order['orderpaymentmethod'] === 'storecredit') {
$GLOBALS['PaymentMethod'] = GetLang('PaymentStoreCredit');
} else {
$GLOBALS['PaymentMethod'] = $order['orderpaymentmethod'];
}
}
$query = "\n\t\tSELECT COUNT(*)\n\t\tFROM [|PREFIX|]order_products\n\t\tWHERE ordprodtype='digital'\n\t\tAND orderorderid='" . $GLOBALS['ISC_CLASS_DB']->Quote($orderId) . "'\n\t";
$numDigitalProducts = $GLOBALS['ISC_CLASS_DB']->FetchOne($query);
$emailTemplate = FetchEmailTemplateParser();
$GLOBALS['SNIPPETS']['CartItems'] = "";
if (OrderIsComplete($status) && $numDigitalProducts > 0) {
$query = "\n\t\t\tSELECT *\n\t\t\tFROM [|PREFIX|]order_products op INNER JOIN [|PREFIX|]products p ON (op.ordprodid = p.productid)\n\t\t\tWHERE ordprodtype='digital'\n\t\t\tAND orderorderid='" . $GLOBALS['ISC_CLASS_DB']->Quote($orderId) . "'\n\t\t";
$result = $GLOBALS['ISC_CLASS_DB']->Query($query);
while ($product_row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
$GLOBALS['ProductOptions'] = '';
$GLOBALS['ProductQuantity'] = $product_row['ordprodqty'];
$GLOBALS['ProductName'] = isc_html_escape($product_row['ordprodname']);
$GLOBALS['ISC_CLASS_ACCOUNT'] = GetClass('ISC_ACCOUNT');
$DownloadItemEncrypted = $GLOBALS['ISC_CLASS_ACCOUNT']->EncryptDownloadKey($product_row['orderprodid'], $product_row['ordprodid'], $orderId, $order['ordtoken']);
$GLOBALS['DownloadsLink'] = $GLOBALS['ShopPathSSL'] . '/account.php?action=download_item&data=' . $DownloadItemEncrypted;
$GLOBALS['SNIPPETS']['CartItems'] .= $emailTemplate->GetSnippet("StatusCompleteDownloadItem");
}
}
if (empty($GLOBALS['SNIPPETS']['CartItems'])) {
$emailTemplate->SetTemplate("order_status_email");
} else {
$emailTemplate->SetTemplate("order_status_downloads_email");
}
$message = $emailTemplate->ParseTemplate(true);
// Create a new email API object to send the email
$store_name = GetConfig('StoreName');
$subject = GetLang('OrderStatusChangedSubject');
require_once ISC_BASE_PATH . "/lib/email.php";
$obj_email = GetEmailClass();
$obj_email->Set('CharSet', GetConfig('CharacterSet'));
$obj_email->From(GetConfig('OrderEmail'), $store_name);
$obj_email->Set('Subject', $subject);
$obj_email->AddBody("html", $message);
$obj_email->AddRecipient($customer['custconemail'], '', "h");
$email_result = $obj_email->Send();
if ($email_result['success']) {
return true;
} else {
return false;
}
}
示例7: CommitVendorPayment
/**
* Actually commit a vendor payment to the database.
*
* @param array An array of details about the vendor payment.
* @return int The ID of the new vendor payment that was just created.
*/
private function CommitVendorPayment($data)
{
if (!isset($data['paymentdeducted'])) {
$data['paymentdeducted'] = 0;
}
if (!isset($data['paymentcomments'])) {
$data['paymentcomments'] = '';
}
$paymentDetails = $this->CalculateOutstandingVendorBalance($data['paymentvendorid']);
$balanceForward = number_format($paymentDetails['balanceForward'], GetConfig('DecimalPlaces'));
$totalOrders = number_format($paymentDetails['totalOrders'], GetConfig('DecimalPlaces'));
$profitMargin = number_format($paymentDetails['profitMargin'], GetConfig('DecimalPlaces'));
$forwardBalance = $balanceForward + $totalOrders - $profitMargin;
if ($data['paymentdeducted']) {
$forwardBalance -= $data['paymentamount'];
}
$data['paymentamount'] = CNumeric($data['paymentamount']);
$newPayment = array('paymentfrom' => $data['paymentfrom'], 'paymentto' => $data['paymentto'], 'paymentvendorid' => $data['paymentvendorid'], 'paymentamount' => $data['paymentamount'], 'paymentforwardbalance' => $forwardBalance, 'paymentmethod' => $data['paymentmethod'], 'paymentdate' => time(), 'paymentdeducted' => $data['paymentdeducted'], 'paymentcomments' => $data['paymentcomments']);
$paymentId = $GLOBALS['ISC_CLASS_DB']->InsertQuery('vendor_payments', $newPayment);
if (isset($data['notifyvendor'])) {
$query = "\n\t\t\t\tSELECT vendorname, vendoremail\n\t\t\t\tFROM [|PREFIX|]vendors\n\t\t\t\tWHERE vendorid='" . (int) $data['paymentvendorid'] . "'\n\t\t\t";
$result = $GLOBALS['ISC_CLASS_DB']->Query($query);
$vendor = $GLOBALS['ISC_CLASS_DB']->Fetch($result);
$emailTemplate = FetchEmailTemplateParser();
$GLOBALS['VendorName'] = isc_html_escape($vendor['vendorname']);
$GLOBALS['VendorPaymentEmail1'] = sprintf(GetLang('VendorPaymentEmail1'), isc_html_escape(GetConfig('StoreName')), CDate($data['paymentfrom']), CDate($data['paymentto']));
$GLOBALS['SalesFrom'] = CDate($data['paymentfrom']);
$GLOBALS['SalesTo'] = CDate($data['paymentto']);
$GLOBALS['OrderTotal'] = FormatPrice($paymentDetails['totalOrders']);
$GLOBALS['PaymentAmount'] = FormatPrice($data['paymentamount']);
$GLOBALS['PaymentMethod'] = isc_html_escape($data['paymentmethod']);
if ($data['paymentcomments']) {
$GLOBALS['Comments'] = '<strong>' . GetLang('Comments') . ':</strong><br />' . isc_html_escape($data['paymentcomments']);
}
$GLOBALS['AccountBalance'] = FormatPrice($forwardBalance);
$emailTemplate->SetTemplate("vendor_payment");
$message = $emailTemplate->ParseTemplate(true);
// Create a new email API object to send the email
$storeName = GetConfig('StoreName');
$subject = sprintf(GetLang('VendorPaymentEmailSubject'), $storeName);
require_once ISC_BASE_PATH . "/lib/email.php";
$objEmail = GetEmailClass();
$objEmail->Set('CharSet', GetConfig('CharacterSet'));
$objEmail->From(GetConfig('AdminEmail'), $storeName);
$objEmail->Set('Subject', $subject);
$objEmail->AddBody("html", $message);
$objEmail->AddRecipient($vendor['vendoremail'], '', "h");
$objEmail->Send();
}
if (!$paymentId) {
return false;
}
return $paymentId;
}
示例8: notifyAdmin
/**
* Notify admin by email of a failed subscription
*
* @param Interspire_EmailIntegration_Subscription $subscription Failed subscription
* @param array $merge Failed merge data
* @param string $errorMessage
*/
public function notifyAdmin(Interspire_EmailIntegration_Subscription $subscription, $merge, $errorMessage)
{
// can't rely on ISC_ADMIN_ENGINE or admin lang stuff from here because this code may be run by the task manager
$languagePath = ISC_BASE_PATH . '/language/' . GetConfig('Language') . '/admin';
ParseLangFile($languagePath . '/common.ini');
ParseLangFile($languagePath . '/settings.emailintegration.ini');
$replacements = array(
'provider' => $this->GetName(),
'time' => isc_date(GetConfig('ExtendedDisplayDateFormat'), time()),
);
$GLOBALS['EmailHeader'] = GetLang("NoCheckoutProvidersSubject");
$GLOBALS['EmailMessage'] = sprintf(GetLang("NoCheckoutProvidersErrorLong"), $GLOBALS['ShopPath']);
$GLOBALS['SubscriptionDetails'] = '';
$GLOBALS['EmailIntegrationNotice_Header'] = GetLang('EmailIntegrationNotice_Header', $replacements);
$GLOBALS['EmailIntegrationNotice_Intro'] = GetLang('EmailIntegrationNotice_Intro', $replacements);
$GLOBALS['EmailIntegrationNotice_Error'] = GetLang('EmailIntegrationNotice_Error', $replacements);
$GLOBALS['EmailIntegrationNotice_Message'] = $errorMessage;
$GLOBALS['EmailIntegrationNotice_Time'] = GetLang('EmailIntegrationNotice_Time', $replacements);
$GLOBALS['EmailIntegrationNotice_Details'] = GetLang('EmailIntegrationNotice_Details', $replacements);
$GLOBALS['EmailIntegrationNotice_Type'] = $subscription->getSubscriptionTypeLang();
$details = new Xhtml_Table();
$row = new Xhtml_Tr();
$row->appendChild(new Xhtml_Th(GetLang('EmailIntegrationNotice_Columns_Provider', $replacements)));
$row->appendChild(new Xhtml_Th(GetLang('EmailIntegrationNotice_Columns_Subscription', $replacements)));
$details->appendChild($row);
$row = new Xhtml_Tr();
$row->appendChild(new Xhtml_Td($this->getEmailProviderFieldId()));
$row->appendChild(new Xhtml_Td($subscription->getSubscriptionEmail()));
$details->appendChild($row);
foreach ($merge as $field => $value) {
$row = new Xhtml_Tr();
$row->appendChild(new Xhtml_Td($field));
$row->appendChild(new Xhtml_Td($value));
$details->appendChild($row);
}
$GLOBALS['EmailIntegrationNotice_Subscription'] = $details->render();
$GLOBALS['EmailIntegrationNotice_CommonCauses'] = GetLang('EmailIntegrationNotice_CommonCauses', $replacements);
$GLOBALS['EmailIntegrationNotice_Cause1_Intro'] = GetLang('EmailIntegrationNotice_Cause1_Intro', $replacements);
$GLOBALS['EmailIntegrationNotice_Cause1_Detail'] = GetLang('EmailIntegrationNotice_Cause1_Detail', $replacements);
$GLOBALS['EmailIntegrationNotice_Cause2_Intro'] = GetLang('EmailIntegrationNotice_Cause2_Intro', $replacements);
$GLOBALS['EmailIntegrationNotice_Cause2_Detail'] = GetLang('EmailIntegrationNotice_Cause2_Detail', $replacements);
$GLOBALS['EmailIntegrationNotice_Cause3_Intro'] = GetLang('EmailIntegrationNotice_Cause3_Intro', $replacements);
$GLOBALS['EmailIntegrationNotice_Cause3_Detail'] = GetLang('EmailIntegrationNotice_Cause3_Detail', $replacements);
$GLOBALS['EmailIntegrationNotice_Cause4_Intro'] = GetLang('EmailIntegrationNotice_Cause4_Intro', $replacements);
$GLOBALS['EmailIntegrationNotice_Cause4_Detail'] = GetLang('EmailIntegrationNotice_Cause4_Detail', $replacements);
$GLOBALS['EmailIntegrationNotice_Cause5_Intro'] = GetLang('EmailIntegrationNotice_Cause5_Intro', $replacements);
$GLOBALS['EmailIntegrationNotice_Cause5_Detail'] = GetLang('EmailIntegrationNotice_Cause5_Detail', $replacements);
$GLOBALS['EmailIntegrationNotice_Closing'] = GetLang('EmailIntegrationNotice_Closing', $replacements);
$emailTemplate = FetchEmailTemplateParser();
$emailTemplate->SetTemplate("email_integration_notice_email");
$message = $emailTemplate->ParseTemplate(true);
$obj_email = GetEmailClass();
$obj_email->Set('CharSet', GetConfig('CharacterSet'));
$obj_email->From(GetConfig('OrderEmail'), GetConfig('StoreName'));
$obj_email->Set("Subject", GetLang("EmailIntegrationEmailSubject"));
$obj_email->AddBody("html", $message);
$obj_email->AddRecipient(GetConfig('AdminEmail'), "", "h");
$email_result = $obj_email->Send();
}
示例9: BuildOrderConfirmation
/**
* Build the contents for the order confirmation page. This function sets up everything to be used by
* the order confirmation on the express checkout page as well as the ConfirmOrder page when using a
* multi step checkout.
*/
public function BuildOrderConfirmation()
{
//alandy.check customer email.
$GLOBALS['Hasemailflag'] = "no";
/*$sql="select customerid from [|PREFIX|]customers where custconemail='".$_SESSION['CHECKOUT']['account_email']."'";
$query=$GLOBALS['ISC_CLASS_DB']->Query($sql);
while($rs=$GLOBALS['ISC_CLASS_DB']->Fetch($query)){
$GLOBALS['Hasemailflag']="yes";
}*/
if ($_SESSION['Haslogin'] == 1) {
$GLOBALS['Hasemailflag'] = "no";
}
if (!GetConfig('ShowMailingListInvite')) {
$GLOBALS['HideMailingListInvite'] = 'none';
}
// Do we need to show the special offers & discounts checkbox and should they
// either of the newsletter checkboxes be ticked by default?
if (GetConfig('MailAutomaticallyTickNewsletterBox')) {
$GLOBALS['NewsletterBoxIsTicked'] = 'checked="checked"';
}
// Is Interspire Email Marketer integrated?
if (GetConfig('MailXMLAPIValid') && GetConfig('UseMailerForOrders') && GetConfig('MailOrderList') > 0) {
// Yes, should we tick the speical offers & discounts checkbox by default?
if (GetConfig('MailAutomaticallyTickOrderBox')) {
$GLOBALS['OrderBoxIsTicked'] = 'checked="checked"';
}
} else {
$GLOBALS['HideOrderCheckBox'] = "none";
}
if (isset($_REQUEST['ordercomments'])) {
$GLOBALS['OrderComments'] = $_REQUEST['ordercomments'];
}
// Now we check if we have an incoming coupon or gift certificate code to apply
if (isset($_REQUEST['couponcode']) && $_REQUEST['couponcode'] != '') {
$code = trim($_REQUEST['couponcode']);
// Were we passed a gift certificate code?
if (isc_strlen($code) == GIFT_CERTIFICATE_LENGTH && gzte11(ISC_LARGEPRINT)) {
$cart = GetClass('ISC_MAKEAOFFER');
if ($cart->api->ApplyGiftCertificate($code)) {
// If successful show a message
$GLOBALS['CheckoutSuccessMsg'] = GetLang('GiftCertificateAppliedToCart');
} else {
$GLOBALS['CheckoutErrorMsg'] = implode('<br />', $cart->api->GetErrors());
}
} else {
$cart = GetClass('ISC_MAKEAOFFER');
if ($cart->api->ApplyCoupon($code)) {
$cart->api->ReapplyCouponsFromCart();
//Added by Simha temp fix to avoid having multiple times coupon for same item
$cart->api->UpdateCartInformation();
// Coupon code applied successfully
$GLOBALS['CheckoutSuccessMsg'] = GetLang('CouponAppliedToCart');
} else {
$GLOBALS['CheckoutErrorMsg'] = implode('<br />', $cart->api->GetErrors());
}
}
}
$GLOBALS['ISC_CLASS_ACCOUNT'] = GetClass('ISC_ACCOUNT');
// Determine what we'll be showing for the redeem gift certificate/coupon code box
if (gzte11(ISC_LARGEPRINT)) {
$GLOBALS['RedeemTitle'] = GetLang('RedeemGiftCertificateOrCoupon');
$GLOBALS['RedeemIntro'] = GetLang('RedeemGiftCertificateorCouponIntro');
} else {
$GLOBALS['RedeemTitle'] = GetLang('RedeemCouponCode');
$GLOBALS['RedeemIntro'] = GetLang('RedeemCouponCodeIntro');
}
$GLOBALS['HideCheckoutError'] = "none";
$GLOBALS['HidePaymentOptions'] = "";
$GLOBALS['HideUseCoupon'] = '';
// if the provider list html is set in session then use it as the payment provider options.
// it's normally set in payment modules when it's required.
if (isset($_SESSION['CHECKOUT']['ProviderListHTML'])) {
$GLOBALS['HidePaymentProviderList'] = "";
$GLOBALS['HidePaymentOptions'] = "";
$GLOBALS['PaymentProviders'] = $_SESSION['CHECKOUT']['ProviderListHTML'];
$GLOBALS['StoreCreditPaymentProviders'] = $_SESSION['CHECKOUT']['ProviderListHTML'];
$GLOBALS['CheckoutWith'] = "";
} else {
// Get a list of checkout providers
$checkoutProviders = GetCheckoutModulesThatCustomerHasAccessTo(true);
// If no checkout providers are set up, send an email to the store owner and show an error message
if (empty($checkoutProviders)) {
$GLOBALS['HideConfirmOrderPage'] = "none";
$GLOBALS['HideCheckoutError'] = '';
$GLOBALS['HideTopPaymentButton'] = "none";
$GLOBALS['HidePaymentProviderList'] = "none";
$GLOBALS['CheckoutErrorMsg'] = GetLang('NoCheckoutProviders');
$GLOBALS['NoCheckoutProvidersError'] = sprintf(GetLang("NoCheckoutProvidersErrorLong"), $GLOBALS['ShopPath']);
$GLOBALS['EmailHeader'] = GetLang("NoCheckoutProvidersSubject");
$GLOBALS['EmailMessage'] = sprintf(GetLang("NoCheckoutProvidersErrorLong"), $GLOBALS['ShopPath']);
$emailTemplate = FetchEmailTemplateParser();
$emailTemplate->SetTemplate("general_email");
$message = $emailTemplate->ParseTemplate(true);
require_once ISC_BASE_PATH . "/lib/email.php";
$obj_email = GetEmailClass();
//.........这里部分代码省略.........
示例10: SendGiftCertificateEmail
/**
* Email a gift certificate to a defined recipient.
* This function will email a gift certificate to a recipient. It generates the gift certificate from
* the selected template and attaches it to the gift certificate email.
*/
public function SendGiftCertificateEmail($giftCertificate)
{
if (!$giftCertificate['cgctoemail']) {
return;
}
$mail_body = $this->GenerateCompanyGiftCertificate($giftCertificate, 'mail');
if (!isset($GLOBALS['ShopPathNormal'])) {
$GLOBALS['ShopPathNormal'] = $GLOBALS['ShopPath'];
}
// Build the email
$narray = explode('$', $giftCertificate['cgcto']);
$earray = explode('$', $giftCertificate['cgctoemail']);
for ($i = 0; $i < count($narray); $i++) {
if (!preg_match("/^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*\$/", $earray[$i])) {
continue;
}
$GLOBALS['ToName'] = isc_html_escape($narray[$i]);
$GLOBALS['FromName'] = GetLang('CompanyGiftCertificateFrom');
$GLOBALS['FromEmail'] = GetConfig('AdminEmail');
$GLOBALS['Amount'] = FormatPrice($giftCertificate['cgcamount']);
$GLOBALS['Intro'] = sprintf(GetLang('CompanyGiftCertificateEmailIntro'), $GLOBALS['FromName'], $GLOBALS['FromEmail'], $GLOBALS['Amount'], $GLOBALS['ShopPathNormal'], $GLOBALS['StoreName']);
$GLOBALS['ISC_LANG']['CompanyGiftCertificateEmailInstructions'] = sprintf(GetLang('CompanyGiftCertificateEmailInstructions'), $GLOBALS['ShopPathNormal']);
$GLOBALS['ISC_LANG']['GiftCertificateFrom'] = sprintf(GetLang('GiftCertificateFrom'), $GLOBALS['StoreName'], $GLOBALS['FromName']);
if ($giftCertificate['cgcexpirydate'] != 0) {
$expiry = CDate($giftCertificate['cgcexpirydate']);
$GLOBALS['GiftCertificateExpiryInfo'] = sprintf(GetLang('CompanyGiftCertificateEmailExpiry'), $expiry);
}
$emailTemplate = FetchEmailTemplateParser();
$emailTemplate->SetTemplate("company_giftcertificate_email");
$message = $emailTemplate->ParseTemplate(true);
//$giftCertificate['giftcerttoemail'] = 'blessen.babu@clariontechnologies.co.in,navya.karnam@clariontechnologies.co.in,wenhuang07@gmail.com,lou@lofinc.net';
// Create a new email API object to send the email
$store_name = GetConfig('StoreName');
$subject = sprintf(GetLang('CompanyGiftCertificateEmailSubject'), $GLOBALS['FromName'], $store_name);
require_once ISC_BASE_PATH . "/lib/email.php";
$obj_email = GetEmailClass();
$obj_email->Set('CharSet', GetConfig('CharacterSet'));
$obj_email->From(GetConfig('AdminEmail'), $store_name);
$obj_email->Set('Subject', $subject);
$obj_email->AddBody("html", $message);
$obj_email->AddRecipient($earray[$i], "", "h");
$obj_email->AddAttachmentData($mail_body, GetLang('CompanyGiftCertificate') . ' #' . $giftCertificate['cgcid'] . ".html");
$updatedCert = array("cgcsended" => 1);
if (GetConfig('CompanyGiftCertificateExpiry') > 0 and $giftCertificate['cgcexpirydate'] == 0) {
$expiry = time() + GetConfig('CompanyGiftCertificateExpiry');
$updatedCert['cgcexpirydate'] = $expiry;
}
$tmpres = $GLOBALS['ISC_CLASS_DB']->UpdateQuery("company_gift_certificates", $updatedCert, "cgcid='" . $GLOBALS['ISC_CLASS_DB']->Quote($giftCertificate['cgcid']) . "'");
$email_result = $obj_email->Send();
}
}
示例11: CreateCustomerAccount
/**
* Actually create a customer account in the database.
*
* @param array An array of details about the customer.
* @param boolean True if a welcome email should be sent out to the customer.
* @param boolean True if this account is being created invisibily for the customer via the checkout.
* @return int The customer ID if successful.
*/
public function CreateCustomerAccount($Customer, $Email=true, $checkoutAccount=false)
{
$entity = new ISC_ENTITY_CUSTOMER();
$customerId = $entity->add($Customer);
if (!isId($customerId)) {
return;
}
// Do we want to email this custome a copy of their registration details?
if ($Email == true) {
$emailTemplate = FetchEmailTemplateParser();
$GLOBALS['FirstName'] = isc_html_escape($Customer['custconfirstname']);
$GLOBALS['Email'] = isc_html_escape($Customer['custconemail']);
$GLOBALS['Password'] = isc_html_escape($Customer['custpassword']);
if($checkoutAccount) {
$GLOBALS['ISC_LANG']['ThanksForRegisteringAtIntro'] = sprintf(GetLang('CheckoutAccountCreatedIntro'), $GLOBALS['StoreName']);
$subject = GetLang('CheckoutAccountCreatedSubject');
$GLOBALS['ISC_LANG']['THanksForRegisteringAt'] = GetLang('CheckoutAccountCreatedSubject');
}
else {
$GLOBALS['ISC_LANG']['ThanksForRegisteringAtIntro'] = sprintf(GetLang('ThanksForRegisteringAtIntro'), $GLOBALS['StoreName']);
$subject = GetLang('ThanksForRegisteringAt');
}
$GLOBALS['ISC_LANG']['ThanksForRegisteringEmailLogin'] = sprintf(GetLang('ThanksForRegisteringEmailLogin'), $GLOBALS['ShopPathSSL']."/account.php", $GLOBALS['ShopPathSSL']."/account.php", $GLOBALS['ShopPathSSL']."/account.php");
$emailTemplate->SetTemplate("createaccount_email");
$message = $emailTemplate->ParseTemplate(true);
// Create a new email API object to send the email
$store_name = GetConfig('StoreName');
require_once(ISC_BASE_PATH . "/lib/email.php");
$obj_email = GetEmailClass();
$obj_email->Set('CharSet', GetConfig('CharacterSet'));
$obj_email->From(GetConfig('OrderEmail'), $store_name);
$obj_email->Set("Subject", $subject . $store_name);
$obj_email->AddBody("html", $message);
$obj_email->AddRecipient($Customer['custconemail'], "", "h");
$email_result = $obj_email->Send();
}
return $customerId;
}
示例12: _endListing
/**
* call this when the job reaches the end of its data to list
*
* @return void
*/
protected function _endListing()
{
$this->_logDebug('end');
$started = (int)$this->_getListingData('started');
$finished = time();
$replacements = array(
'template' => $this->_getListingData('template_name'),
'success_count' => (int)$this->_getListingData('success_count'),
'error_count' => (int)$this->_getListingData('error_count'),
'warning_count' => (int)$this->_getListingData('warning_count'),
'start' => isc_date(GetConfig('ExtendedDisplayDateFormat'), $started),
'end' => isc_date(GetConfig('ExtendedDisplayDateFormat'), $finished),
'total' => (int)$this->_getListingData('actual_processed'),
);
// notify user that started export of completion
$obj_email = GetEmailClass();
$obj_email->Set('CharSet', GetConfig('CharacterSet'));
$obj_email->From(GetConfig('OrderEmail'), GetConfig('StoreName'));
$obj_email->Set("Subject", GetLang("Ebay_Listing_End_Email_Subject", $replacements));
$obj_email->AddRecipient($this->_getListingData('owner:email'), "", "h");
$emailTemplate = FetchEmailTemplateParser();
$emailTemplate->SetTemplate("ebay_listing_finished");
$emailTemplate->Assign('EmailHeader', GetLang("Ebay_Listing_End_Email_Subject", $replacements));
$emailTemplate->Assign('Ebay_Listing_End_Email_Message_1', GetLang('Ebay_Listing_End_Email_Message_1', $replacements));
$emailTemplate->Assign('Ebay_Listing_End_Email_Message_2', GetLang('Ebay_Listing_End_Email_Message_2', $replacements));
$emailTemplate->Assign('Ebay_Listing_End_Email_Message_3', GetLang('Ebay_Listing_End_Email_Message_3', $replacements));
$emailTemplate->Assign('Ebay_Listing_End_Email_Message_4', GetLang('Ebay_Listing_End_Email_Message_4', $replacements));
// process errors
if ($replacements['error_count']) {
$errors = $this->_keystore->multiGet($this->_prefix . 'error:*');
$errorHTML = '';
$limit = 100; // limit number of errors reported via email to 100
while (!empty($errors) && $limit) {
$error = array_pop($errors);
$error = ISC_JSON::decode($error, true);
if (!$error) {
// json decode error?
continue;
}
$errorHTML .= '
<dt>' . $error['prodname'] . '</dt>
<dd>' . $error['message'] . '</dd>
<br />
';
$limit--;
}
if ($errorHTML) {
$errorHTML = '<dl>' . $errorHTML . '</dl>';
// only show the heading if error info was successfully generated
$emailTemplate->Assign('Ebay_Listing_End_Email_Errors_Heading', GetLang('Ebay_Listing_End_Email_Errors_Heading', $replacements));
$emailTemplate->Assign('Ebay_Listing_End_Email_Errors', $errorHTML);
}
}
// process warnings
if ($replacements['warning_count']) {
$errors = $this->_keystore->multiGet($this->_prefix . 'warning:*');
$errorHTML = '';
$limit = 100; // limit number of warnings reported via email to 100
while (!empty($errors) && $limit) {
$error = array_pop($errors);
$error = ISC_JSON::decode($error, true);
if (!$error) {
// json decode error?
continue;
}
$errorHTML .= '
<dt>' . $error['prodname'] . '</dt>
<dd>' . $error['message'] . '</dd>
<br />
';
$limit--;
}
if ($errorHTML) {
$errorHTML = '<dl>' . $errorHTML . '</dl>';
// only show the heading if error info was successfully generated
$emailTemplate->Assign('Ebay_Listing_End_Email_Warnings_Heading', GetLang('Ebay_Listing_End_Email_Warnings_Heading', $replacements));
$emailTemplate->Assign('Ebay_Listing_End_Email_Warnings', $errorHTML);
//.........这里部分代码省略.........
示例13: paserRequestTemplate
public function paserRequestTemplate($templateId, $type = 'preview')
{
if ($type == 'email') {
$this->GetOrderDetail($_REQUEST['o'], "eamil");
} else {
$this->GetOrderDetail($_REQUEST['orderId'], "review");
}
$showContent = '';
$requestTemplate = '';
$query = "select request_script_value,coupon_code from [|PREFIX|]order_review_request where id='" . $templateId . "'";
$result = $GLOBALS['ISC_CLASS_DB']->Query($query);
if ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
$coupon_code_hint = "";
if (!empty($row['coupon_code'])) {
$coupon_code_hint = GetLang('CouponCodeHint') . $row['coupon_code'];
}
//coupon code should not be included in the email
/*if($type == 'email'){
$coupon_code_hint = "";
}*/
$coupon_code_hint = "";
$order_reviewlink = sprintf("<a href='%s' target='_blank'>%s</a>", $GLOBALS['OrderReviewLink'], GetLang('OrderReviewLinkTitle'));
$replaceArr = array('<!--ORDER_DATE-->' => $GLOBALS['OrderDate'], '<!--ORDER DATE-->' => $GLOBALS['OrderDate'], '<!--ORDER_DETAILS-->' => $GLOBALS['OrderDetails'], '<!--ORDER_REVIEW_LINK-->' => $order_reviewlink, '<!--ORDER_COUPON_CODE-->' => $coupon_code_hint);
$requestTemplate = $row['request_script_value'];
$requestTemplate = str_ireplace("/admin/", "", $requestTemplate);
$requestTemplate = htmlspecialchars_decode($requestTemplate);
foreach ($replaceArr as $replaceReg => $replaceText) {
$requestTemplate = str_replace($replaceReg, $replaceText, $requestTemplate);
}
}
if ($type == 'preview') {
$showContent = $requestTemplate;
} else {
if ($type == 'email') {
$GLOBALS['RequestDetail'] = $requestTemplate;
$emailTemplate = FetchEmailTemplateParser();
$emailTemplate->SetTemplate("order_reviewrequest_email");
$showContent = $emailTemplate->ParseTemplate(true);
}
}
return $showContent;
}
示例14: SaveNewOrderMessage
private function SaveNewOrderMessage()
{
if (isset($_POST['orderId']) && isset($_POST['subject']) && isset($_POST['message'])) {
$order_id = (int) $_POST['orderId'];
// Does this user have permission to view this order?
$order = GetOrder($order_id);
if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->GetVendorId() && $order['ordvendorid'] != $GLOBALS['ISC_CLASS_ADMIN_AUTH']->GetVendorId()) {
FlashMessage(GetLang('Unauthorized'), MSG_ERROR, 'index.php?ToDo=viewOrders');
}
$subject = $_POST['subject'];
$message = $_POST['message'];
// Save the message to the database first
$newMessage = array("messagefrom" => "admin", "subject" => $subject, "message" => $message, "datestamp" => time(), "messageorderid" => $order_id, "messagestatus" => "unread", "staffuserid" => $GLOBALS['ISC_CLASS_ADMIN_AUTH']->GetUserId(), "isflagged" => 0);
$message_id = $GLOBALS['ISC_CLASS_DB']->InsertQuery("order_messages", $newMessage);
if ($message_id) {
$message_id = $GLOBALS['ISC_CLASS_DB']->LastId();
// Log this action
$GLOBALS['ISC_CLASS_LOG']->LogAdminAction($message_id, $order_id);
// Now send a notification email to the customer
$customer_email = $this->GetCustomerEmailByOrderId($order_id);
// Create a new email API object to send the email
$store_name = GetConfig('StoreName');
$emailTemplate = FetchEmailTemplateParser();
$emailTemplate->SetTemplate("ordermessage_notification");
$message = $emailTemplate->ParseTemplate(true);
require_once ISC_BASE_PATH . "/lib/email.php";
$obj_email = GetEmailClass();
$obj_email->Set('CharSet', GetConfig('CharacterSet'));
$obj_email->From(GetConfig('OrderEmail'), $store_name);
$obj_email->Set("Subject", $subject);
$obj_email->AddBody("html", $message);
$obj_email->AddRecipient($customer_email, "", "h");
$email_result = $obj_email->Send();
if ($email_result['success']) {
$this->ViewOrderMessages(GetLang('OrderMessageSentOK'), MSG_SUCCESS);
} else {
$this->ViewOrderMessages(GetLang('OrderMessagesSentEmailFailed'), MSG_ERROR);
}
} else {
$this->ViewOrderMessages(GetLang('OrderMessagesSentFailed'), MSG_ERROR);
}
}
}
示例15: BuildOrderConfirmation
//.........这里部分代码省略.........
$GLOBALS['RedeemIntro'] = GetLang('RedeemCouponCodeIntro');
}
$GLOBALS['HideCheckoutError'] = "none";
$GLOBALS['HidePaymentOptions'] = "";
$GLOBALS['HideUseCoupon'] = '';
$checkoutProviders = array();
// if the provider list html is set in session then use it as the payment provider options.
// it's normally set in payment modules when it's required.
if(isset($_SESSION['CHECKOUT']['ProviderListHTML'])) {
$GLOBALS['HidePaymentProviderList'] = "";
$GLOBALS['HidePaymentOptions'] = "";
$GLOBALS['PaymentProviders'] = $_SESSION['CHECKOUT']['ProviderListHTML'];
$GLOBALS['StoreCreditPaymentProviders'] = $_SESSION['CHECKOUT']['ProviderListHTML'];
$GLOBALS['CheckoutWith'] = "";
} else {
// Get a list of checkout providers
$checkoutProviders = GetCheckoutModulesThatCustomerHasAccessTo(true);
// If no checkout providers are set up, send an email to the store owner and show an error message
if (empty($checkoutProviders)) {
$GLOBALS['HideConfirmOrderPage'] = "none";
$GLOBALS['HideCheckoutError'] = '';
$GLOBALS['HideTopPaymentButton'] = "none";
$GLOBALS['HidePaymentProviderList'] = "none";
$GLOBALS['CheckoutErrorMsg'] = GetLang('NoCheckoutProviders');
$GLOBALS['NoCheckoutProvidersError'] = sprintf(GetLang("NoCheckoutProvidersErrorLong"), $GLOBALS['ShopPath']);
$GLOBALS['EmailHeader'] = GetLang("NoCheckoutProvidersSubject");
$GLOBALS['EmailMessage'] = sprintf(GetLang("NoCheckoutProvidersErrorLong"), $GLOBALS['ShopPath']);
$emailTemplate = FetchEmailTemplateParser();
$emailTemplate->SetTemplate("general_email");
$message = $emailTemplate->ParseTemplate(true);
require_once(ISC_BASE_PATH . "/lib/email.php");
$obj_email = GetEmailClass();
$obj_email->Set('CharSet', GetConfig('CharacterSet'));
$obj_email->From(GetConfig('OrderEmail'), GetConfig('StoreName'));
$obj_email->Set("Subject", GetLang("NoCheckoutProvidersSubject"));
$obj_email->AddBody("html", $message);
$obj_email->AddRecipient(GetConfig('AdminEmail'), "", "h");
$email_result = $obj_email->Send();
}
// We have more than one payment provider, hide the top button and build a list
else if (count($checkoutProviders) > 1) {
$GLOBALS['HideTopPaymentButton'] = "none";
$GLOBALS['HideCheckoutError'] = "none";
}
// There's only one payment provider - hide the list
else {
$GLOBALS['HidePaymentProviderList'] = "none";
$GLOBALS['HideCheckoutError'] = "none";
$GLOBALS['HidePaymentOptions'] = "none";
list(,$provider) = each($checkoutProviders);
if(method_exists($provider['object'], 'ShowPaymentForm') && !isset($_SESSION['CHECKOUT']['ProviderListHTML'])) {
$GLOBALS['ExpressCheckoutLoadPaymentForm'] = 'ExpressCheckout.ShowSingleMethodPaymentForm();';
}
if ($provider['object']->GetPaymentType() == PAYMENT_PROVIDER_OFFLINE) {
$GLOBALS['PaymentButtonSwitch'] = "ShowContinueButton();";
}
$GLOBALS['CheckoutWith'] = $provider['object']->GetDisplayName();