本文整理汇总了PHP中GetEmailClass函数的典型用法代码示例。如果您正苦于以下问题:PHP GetEmailClass函数的具体用法?PHP GetEmailClass怎么用?PHP GetEmailClass使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetEmailClass函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: SendNotification
/**
* Send the order notification email
*/
public function SendNotification()
{
$emails = array();
$this->_message = $this->BuildEmailMessage();
$this->_email = $this->GetValue("emailaddress");
if (empty($this->_email)) {
return;
}
$emails = preg_split('#[,\\s]+#si', $this->_email, -1, PREG_SPLIT_NO_EMPTY);
// Create a new email object through which 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", sprintf(GetLang('NEmailSubjectLine'), $this->GetOrderId(), $store_name, FormatPrice($this->GetOrderTotal(), false, true, false, GetDefaultCurrency())));
$obj_email->AddBody("html", $this->_message);
// Add all recipients
foreach ($emails as $email) {
$obj_email->AddRecipient($email, "", "h");
}
$email_result = $obj_email->Send();
if ($email_result['success']) {
$result = array("outcome" => "success", "message" => sprintf(GetLang('EmailNotificationSentUser'), implode("<br />", $emails)));
} else {
$result = array("outcome" => "fail", "message" => GetLang('NEmailSendingFailed'));
}
return $result;
}
示例2: 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;
}
}
示例3: 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;
}
}
示例4: _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();
}
示例5: 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();
}
示例6: SaveNewPassword
/**
* Save the new password for the customer's account
*/
private function SaveNewPassword()
{
if (isset($_GET['c']) && isset($_GET['t'])) {
$customerId = (int) isc_html_escape($_GET['c']);
$customerHash = isc_html_escape($_GET['t']);
$query = "SELECT *\n\t\t\t\t\t\t\tFROM [|PREFIX|]customers\n\t\t\t\t\t\t\tWHERE customerid=" . $customerId;
$result = $GLOBALS['ISC_CLASS_DB']->Query($query);
$customer = $GLOBALS['ISC_CLASS_DB']->Fetch($result);
// Can't find them in the database
if (!isId($customerId) || !$customer) {
return $this->ResetPassword("invalid_link", 1);
}
// Also check to see if our salted string matches this customer
if (!CustomerHashCheck($customerHash, $customer['customerpasswordresettoken'], $customerId)) {
return $this->ResetPassword("invalid_link", 1);
}
// OK, all the arguments are cool. Now we generate a password for them
$password = GenerateReadablePassword();
$updateData = array('custpassword' => md5($password), 'customerpasswordresettoken' => '', 'customerpasswordresetemail' => '');
if ($GLOBALS['ISC_CLASS_DB']->UpdateQuery('customers', $updateData, 'customerid=' . $customerId) === false) {
return $this->ResetPassword("internal_error", 1);
}
// Send the email
$store_name = GetConfig('StoreName');
$email_message = sprintf(GetLang('ForgotPasswordEmailConfirmed'), $store_name, $password);
// Create a new email API object to send the email
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('ForgotPasswordEmailConfirmedSubject'), $store_name));
$obj_email->AddBody("html", $email_message);
$obj_email->AddRecipient($customer['customerpasswordresetemail'], "", "h");
$email_result = $obj_email->Send();
if ($email_result['success']) {
return $this->ShowLoginPage(sprintf(GetLang('ForgotPasswordChanged'), $customer['customerpasswordresetemail']), 0, true);
} else {
return $this->ResetPassword("internal_error", 1);
}
} else {
$this->ShowLoginPage();
}
}
示例7: 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'];
//.........这里部分代码省略.........
示例8: SaveNewOfferMessage
private function SaveNewOfferMessage()
{
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=viewOffers');
}
$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("offer_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->ViewOfferMessages(GetLang('OrderMessageSentOK'), MSG_SUCCESS);
} else {
$this->ViewOfferMessages(GetLang('OrderMessagesSentEmailFailed'), MSG_ERROR);
}
} else {
$this->ViewOfferMessages(GetLang('OrderMessagesSentFailed'), MSG_ERROR);
}
}
}
示例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: SendMail
private function SendMail()
{
$_GET['product'] = $_REQUEST['product'] = $_POST['productid'];
// Load the data for this product
$this->_SetOfferData();
//zcs=>
$GLOBALS['ISC_CLASS_CAPTCHA'] = GetClass('ISC_CAPTCHA');
$captcha = trim($_REQUEST['captcha']);
if (isc_strtolower($captcha) != isc_strtolower($GLOBALS['ISC_CLASS_CAPTCHA']->LoadSecret())) {
// Captcha validation failed
echo "<script language=\"javascript\">alert('Invalid captcha!'); history.back();</script>";
exit;
}
if (!$this->GetProductId()) {
echo "<script language=\"javascript\">alert('Invalid product!'); history.back();</script>";
exit;
}
//<=zcs
$subject = "Make an Offer";
$email = trim($_REQUEST['email']);
$offer = "\$" . trim($_REQUEST['offer']);
$producttitle = $_REQUEST['prodtitle'];
$price = $_REQUEST['price'];
$state = $_REQUEST['state'];
if ($state != '0') {
$statename = $state;
} else {
$statename = "State not selected";
}
$zipcode = $_REQUEST['zipcode'];
$comment = $_REQUEST['comments'];
$content = $this->_message;
$prodtitle = "<!--PRODUCT-TITLE-->";
$listedprice = "<!--LISTED-PRICE-->";
$offeredprice = "<!--OFFERED-PRICE-->";
$cusemail = "<!--CUSTOMER-EMAIL-->";
$statetag = "<!--STATE-->";
$zipcodetag = "<!--ZIPCODE-->";
$commenttag = "<!--COMMENT-->";
$title = str_replace($prodtitle, $producttitle, $content);
$lisprice = str_replace($listedprice, $price, $title);
$offprice = str_replace($offeredprice, $offer, $lisprice);
$emailreplace = str_replace($cusemail, $email, $offprice);
$statereplace = str_replace($statetag, $statename, $emailreplace);
$zip = str_replace($zipcodetag, $zipcode, $statereplace);
$message = str_replace($commenttag, $comment, $zip);
$to = $this->_emailids;
require_once ISC_BASE_PATH . "/lib/email.php";
$obj_email = GetEmailClass();
$obj_email->Set('CharSet', GetConfig('CharacterSet'));
$obj_email->From(GetConfig('OrderEmail'), $email);
$obj_email->Set('ReplyTo', $email);
$obj_email->Set("Subject", $subject);
$obj_email->AddBody("html", $message);
$obj_email->AddRecipient($to, "", "h");
$email_result = $obj_email->Send();
if ($email_result) {
header("Location: " . $GLOBALS['ShopPath'] . "/offer.php?product=MailSend");
}
}
示例11: _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);
//.........这里部分代码省略.........
示例12: sendImageUploaderEmail
function sendImageUploaderEmail()
{
if ($_POST['sendEmail']) {
$customerid = $GLOBALS['ISC_CLASS_CUSTOMER']->GetCustomerId();
$sql1 = "SELECT image_last_upload\n\t\t\t\t\tFROM [|PREFIX|]customers\n\t\t\t\t\tWHERE customerid='" . (int) $customerid . "'";
$result1 = $GLOBALS['ISC_CLASS_DB']->Query($sql1);
$uploadNum = $GLOBALS['ISC_CLASS_DB']->FetchOne($result1);
if ($uploadNum <= 0) {
// don't send email
return false;
} else {
$subject = 'Upload Image Notification';
$message = "{$uploadNum} photo(s) have just been uploaded to TruckChamp.com";
$name = "Administrator";
$to = GetConfig("ImageUploaderSettingsNotifyEmail");
require_once ISC_BASE_PATH . "/lib/email.php";
$obj_email = GetEmailClass();
$obj_email->Set('CharSet', GetConfig('CharacterSet'));
$obj_email->From(GetConfig('OrderEmail'), $name);
$obj_email->Set('ReplyTo', GetConfig('OrderEmail'));
$obj_email->Set("Subject", $subject);
$obj_email->AddBody("html", $message);
$obj_email->AddRecipient($to, "", "h");
$email_result = $obj_email->Send();
if ($email_result) {
$customerEntity = new ISC_ENTITY_CUSTOMER();
$customerEntity->clearImageLastUpload($GLOBALS['ISC_CLASS_CUSTOMER']->GetCustomerId());
} else {
return false;
}
}
} else {
return false;
}
}
示例13: SendRequestByEmail
private function SendRequestByEmail($email)
{
//load the template for email, e.g. $email = "wirror.yin@nirvana-info.com";
$templateId = 1;
if (isset($_GET['templateId']) && is_numeric($_GET['templateId'])) {
$templateId = (int) $_GET['templateId'];
}
$message = $this->paserRequestTemplate($templateId, 'email');
// Create a new email API object to send the email
$store_name = GetConfig('StoreName');
$subject = sprintf(GetLang('ReviewRequestEmailSubject'), $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($email, "", "h");
//$obj_email->AddAttachmentData($data, $name);
$email_result = $obj_email->Send();
return true;
}
示例14: sendUnblockRequestEmail
/**
* Sends a reset password request email with a token link
*
* @param integer $userid The user ID
* @param integer $lockout The timestamp of when this lockout will expire
* @param string $msg Reference message string
*
* @param boolean
*/
public function sendUnblockRequestEmail($userid, $lockout=0, &$msg='')
{
$user = $this->getUserByField('pk_userid', $userid, '*');
if ($lockout == 0) {
$lockout = $user['attempt_lockout'];
}
// expired?
if ($lockout < time()) {
return false;
}
// build the link with a reset lockout token
$storeName = GetConfig('StoreName');
$token = md5($lockout.$userid);
$subject = GetLang('UnblockRequestEmailSubject', array(
'username' => isc_html_escape($user['username']),
));
$message = GetLang('UnblockRequestEmailContent', array(
'username' => isc_html_escape($user['username']),
'storeName' => isc_html_escape($storeName),
'confirmUrl' => GetConfig('ShopPath').'/admin/index.php?ToDo=unblock&step=unblock&t='.$token,
'unlockTime' => isc_date(GetConfig('ExtendedDisplayDateFormat'), $lockout),
));
// send the email
require_once(ISC_BASE_PATH . "/lib/email.php");
$obj_email = GetEmailClass();
$obj_email->Set('CharSet', GetConfig('CharacterSet'));
$obj_email->From(GetConfig('OrderEmail'), $storeName);
$obj_email->Set('Subject', $subject);
$obj_email->AddBody('html', $message);
$obj_email->AddRecipient(GetConfig('AdminEmail'));
if(!$obj_email->Send()) {
$err = GetLang('NoEmailSystem');
return false;
}
$msg = GetLang('SendUnblockRequestEmailSuccess', array(
'lockoutTime'=> GetConfig('PCILoginLockoutTimeMin'),
));
return true;
}//end sendUnblockRequestEmail()
示例15: 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();
}