本文整理汇总了PHP中mslib_fe::mailUser方法的典型用法代码示例。如果您正苦于以下问题:PHP mslib_fe::mailUser方法的具体用法?PHP mslib_fe::mailUser怎么用?PHP mslib_fe::mailUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mslib_fe
的用法示例。
在下文中一共展示了mslib_fe::mailUser方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateOrderStatus
//.........这里部分代码省略.........
$array2[] = $order['delivery_zip'];
$array1[] = '###DELIVERY_CITY###';
$array2[] = $order['delivery_city'];
$array1[] = '###DELIVERY_COUNTRY###';
$array2[] = mslib_fe::getTranslatedCountryNameByEnglishName($this->lang, $order['delivery_country']);
$array1[] = '###DELIVERY_COUNTRY_CODE###';
$array2[] = mslib_fe::getCountryCnIsoByEnglishName($order['delivery_country']);
// dynamic variablese eof
//hook to let other plugins further manipulate
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_befe.php']['updateOrderStatusMarkerReplacerProc'])) {
$params = array('array1' => &$array1, 'array2' => &$array2, 'order' => &$order);
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_befe.php']['updateOrderStatusMarkerReplacerProc'] as $funcRef) {
\TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
}
}
if ($this->post['comments']) {
$this->post['comments'] = str_replace($array1, $array2, $this->post['comments']);
}
$status_last_modified = time();
$updateArray = array();
$updateArray['orders_id'] = $order['orders_id'];
$updateArray['old_value'] = $order['status'];
$updateArray['comments'] = $this->post['comments'];
$updateArray['customer_notified'] = $mail_customer;
$updateArray['crdate'] = $status_last_modified;
$updateArray['new_value'] = $orders_status;
$updateArray['requester_ip_addr'] = $this->REMOTE_ADDR;
$query = $GLOBALS['TYPO3_DB']->INSERTquery('tx_multishop_orders_status_history', $updateArray);
if ($orders_status == $order['status']) {
if (!empty($this->post['comments']) && $mail_customer) {
// always save the order status history even when order status is the same as the old one when e-mail to client is filled
$res = $GLOBALS['TYPO3_DB']->sql_query($query);
}
$returnTrue = 0;
} else {
// save if new order status history is different than the old status
$res = $GLOBALS['TYPO3_DB']->sql_query($query);
$returnTrue = 1;
}
$updateArray = array();
$updateArray['status'] = $orders_status;
$updateArray['status_last_modified'] = $status_last_modified;
$order['old_status'] = $order['status'];
$order['status'] = $orders_status;
$updateArray['orders_last_modified'] = time();
$query = $GLOBALS['TYPO3_DB']->UPDATEquery('tx_multishop_orders', 'orders_id=\'' . $orders_id . '\'', $updateArray);
$res = $GLOBALS['TYPO3_DB']->sql_query($query);
//send e-mail
if ($mail_customer) {
$subject = $this->ms['MODULES']['STORE_NAME'];
$message = $this->post['comments'];
if ($orders_status) {
$orders_status_name = mslib_fe::getOrderStatusName($orders_status, 0);
$keys = array();
$keys[] = 'email_order_status_changed_' . mslib_befe::strtolower($orders_status_name);
$keys[] = 'email_order_status_changed';
foreach ($keys as $key) {
//$page=mslib_fe::getCMScontent($key,$GLOBALS['TSFE']->sys_language_uid);
$page = mslib_fe::getCMScontent($key, $order['language_id']);
if ($page[0]) {
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_befe.php']['updateOrderStatusMarkerReplacerPostProc'])) {
$params = array('array1' => &$array1, 'array2' => &$array2, 'page' => &$page);
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_befe.php']['updateOrderStatusMarkerReplacerPostProc'] as $funcRef) {
\TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
}
}
if ($page[0]['content']) {
$page[0]['content'] = str_replace($array1, $array2, $page[0]['content']);
}
if ($page[0]['name']) {
$page[0]['name'] = str_replace($array1, $array2, $page[0]['name']);
}
$user = array();
$user['email'] = $order['billing_email'];
$user['name'] = $order['billing_name'];
if ($user['email']) {
mslib_fe::mailUser($user, $page[0]['name'], $page[0]['content'], $this->ms['MODULES']['STORE_EMAIL'], $this->ms['MODULES']['STORE_NAME']);
}
break;
}
}
}
}
if (isset($order['language_id'])) {
// Switch back to default language
mslib_befe::resetSystemLanguage();
}
//hook to let other plugins further manipulate
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_befe.php']['updateOrderStatusPostProc'])) {
$params = array('orders_id' => &$orders_id, 'orders_status' => &$orders_status, 'mail_customer' => &$mail_customer, 'order' => &$order, 'array1' => &$array1, 'array2' => &$array2);
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_befe.php']['updateOrderStatusPostProc'] as $funcRef) {
\TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
}
}
if ($returnTrue) {
return true;
}
}
}
}
示例2: convertCartToOrder
//.........这里部分代码省略.........
}
//$insertArray['orders_tax_data'] = serialize($orders_tax);
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/class.tx_multishop_pi1.php']['insertOrderPreProc'])) {
// hook
$params = array('ms' => $this->ms, 'address' => &$address, 'insertArray' => &$insertArray);
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/class.tx_multishop_pi1.php']['insertOrderPreProc'] as $funcRef) {
\TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
}
// hook oef
}
$insertArray = mslib_befe::rmNullValuedKeys($insertArray);
$query = $GLOBALS['TYPO3_DB']->INSERTquery('tx_multishop_orders', $insertArray);
$res = $GLOBALS['TYPO3_DB']->sql_query($query);
// now add the order eof
$orders_id = $GLOBALS['TYPO3_DB']->sql_insert_id();
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/class.tx_multishop_pi1.php']['insertOrderPostProc'])) {
// hook
$params = array('orders_id' => &$orders_id, 'insertArray' => &$insertArray, 'cart' => &$cart);
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/class.tx_multishop_pi1.php']['insertOrderPostProc'] as $funcRef) {
\TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
}
// hook oef
}
if (!$orders_id) {
$subject = $this->FULL_HTTP_URL . ' - Convert cart to order failed';
$body = 'Warning. Convert cart to order failed.<br/>Website: ' . $this->FULL_HTTP_URL . '<br/>Error: ' . $GLOBALS['TYPO3_DB']->sql_error() . '<br/>Query:<br/>' . $query;
$mailuser = array();
$mailuser['name'] = $this->ms['MODULES']['STORE_NAME'];
$mailuser['email'] = $this->ms['MODULES']['STORE_EMAIL'];
if ($this->ms['MODULES']['DEVELOPER_EMAIL']) {
$mailuser['email'] = $this->ms['MODULES']['DEVELOPER_EMAIL'];
}
if ($mailuser['email']) {
mslib_fe::mailUser($mailuser, $subject, $body, $this->ms['MODULES']['STORE_EMAIL'], $this->ms['MODULES']['STORE_NAME']);
}
} else {
// now add the orders products
if ($cart['user']['payment_method']) {
$this->ms['payment_method'] = $cart['user']['payment_method'];
} elseif ($cart['user']['shipping_method']) {
$this->ms['shipping_method'] = $cart['user']['shipping_method'];
}
if (is_array($cart['products']) && count($cart['products'])) {
foreach ($cart['products'] as $shopping_cart_item => $value) {
if (is_numeric($value['products_id'])) {
if ($this->ms['MODULES']['DISABLE_VAT_RATE']) {
$value['tax_rate'] = 0;
}
$insertArray = array();
$insertArray['orders_id'] = $orders_id;
$insertArray['products_id'] = $value['products_id'];
$insertArray['categories_id'] = $value['categories_id'];
// get all cats
$cats = mslib_fe::Crumbar($value['categories_id']);
$cats = array_reverse($cats);
if (count($cats) > 0) {
$i = 0;
foreach ($cats as $cat) {
$insertArray['categories_id_' . $i] = $cat['id'];
$insertArray['categories_name_' . $i] = $cat['name'];
$i++;
}
}
// get all cats eof
if (isset($value['manufacturers_id']) && !empty($value['manufacturers_id'])) {
$insertArray['manufacturers_id'] = $value['manufacturers_id'];
示例3: str_replace
if ($page[0]['content']) {
$page[0]['content'] = str_replace($array1, $array2, $page[0]['content']);
$reminder_cms_content .= $page[0]['content'];
}
$full_customer_name = $tmpArray['billing_first_name'];
if ($order['billing_middle_name']) {
$full_customer_name .= ' ' . $tmpArray['billing_middle_name'];
}
if ($order['billing_last_name']) {
$full_customer_name .= ' ' . $tmpArray['billing_last_name'];
}
$user = array();
$user['name'] = $full_customer_name;
$user['email'] = $tmpArray['billing_email'];
if ($user['email']) {
mslib_fe::mailUser($user, $page[0]['name'], $page[0]['content'], $this->ms['MODULES']['STORE_EMAIL'], $this->ms['MODULES']['STORE_NAME']);
}
}
}
}
}
break;
default:
// post processing by third party plugins
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/scripts/admin_pages/admin_orders.php']['adminOrdersPostHookProc'])) {
$params = array('content' => &$content, 'postErno' => &$postErno);
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/scripts/admin_pages/admin_orders.php']['adminOrdersPostHookProc'] as $funcRef) {
\TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
}
}
break;
示例4: sendCreateAccountConfirmationLetter
function sendCreateAccountConfirmationLetter($customer_id, $password = '')
{
if (!is_numeric($customer_id)) {
return false;
}
$page = mslib_fe::getCMScontent('email_create_account_confirmation', $GLOBALS['TSFE']->sys_language_uid);
if ($page[0]['content']) {
$newCustomer = mslib_fe::getUser($customer_id);
// loading the email confirmation letter eof
// replacing the variables with dynamic values
$array1 = array();
$array2 = array();
$array1[] = '###GENDER_SALUTATION###';
$array2[] = mslib_fe::genderSalutation($this->post['gender']);
$array1[] = '###BILLING_COMPANY###';
$array2[] = $newCustomer['company'];
$array1[] = '###FULL_NAME###';
$array2[] = $newCustomer['name'];
$array1[] = '###BILLING_NAME###';
$array2[] = $newCustomer['name'];
$array1[] = '###BILLING_FIRST_NAME###';
$array2[] = $newCustomer['first_name'];
$array1[] = '###BILLING_LAST_NAME###';
$last_name = $newCustomer['last_name'];
if ($newCustomer['middle_name']) {
$last_name = $newCustomer['middle_name'] . ' ' . $last_name;
}
$array2[] = $last_name;
$array1[] = '###CUSTOMER_EMAIL###';
$array2[] = $newCustomer['email'];
$array1[] = '###BILLING_EMAIL###';
$array2[] = $newCustomer['email'];
$array1[] = '###BILLING_ADDRESS###';
$array2[] = $newCustomer['address'];
$array1[] = '###BILLING_TELEPHONE###';
$array2[] = $newCustomer['telephone'];
$array1[] = '###BILLING_MOBILE###';
$array2[] = $newCustomer['mobile'];
$array1[] = '###LONG_DATE###';
// ie woensdag 23 juni, 2010
$long_date = strftime($this->pi_getLL('full_date_format'));
$array2[] = $long_date;
$array1[] = '###CURRENT_DATE_LONG###';
// ie woensdag 23 juni, 2010
$long_date = strftime($this->pi_getLL('full_date_format'));
$array2[] = $long_date;
$array1[] = '###STORE_NAME###';
$array2[] = $this->ms['MODULES']['STORE_NAME'];
$array1[] = '###CUSTOMER_ID###';
$array2[] = $customer_id;
$link = $this->FULL_HTTP_URL . mslib_fe::typolink($this->shop_pid . ',2002', '&tx_multishop_pi1[page_section]=confirm_create_account&tx_multishop_pi1[hash]=' . $newCustomer['tx_multishop_code']);
$array1[] = '###LINK###';
$array2[] = '<a href="' . $link . '" rel="noreferrer">' . htmlspecialchars($this->pi_getLL('click_here_to_confirm_registration')) . '</a>';
$array1[] = '###CONFIRMATION_LINK###';
$array2[] = '<a href="' . $link . '" rel="noreferrer">' . htmlspecialchars($this->pi_getLL('click_here_to_confirm_registration')) . '</a>';
$array1[] = '###USERNAME###';
$array2[] = $newCustomer['email'];
$array1[] = '###PASSWORD###';
$array2[] = $password;
if ($page[0]['content']) {
$page[0]['content'] = str_replace($array1, $array2, $page[0]['content']);
}
if ($page[0]['name']) {
$page[0]['name'] = str_replace($array1, $array2, $page[0]['name']);
}
$user = array();
$user['name'] = $newCustomer['first_name'];
$user['email'] = $newCustomer['email'];
mslib_fe::mailUser($user, $page[0]['name'], $page[0]['content'], $this->ms['MODULES']['STORE_EMAIL'], $this->ms['MODULES']['STORE_NAME']);
return true;
}
}
示例5: mailOrder
//.........这里部分代码省略.........
if ($page[0]['name']) {
$page[0]['name'] = str_replace($array1, $array2, $page[0]['name']);
}
// replacing the variables with dynamic values eof
$user = array();
$user['name'] = $full_customer_name;
$user['email'] = $custom_email_address;
//hook
$send_mail = 1;
$mail_attachment = array();
$add_invoice_attachment_on_templates = array();
$add_invoice_attachment_on_templates[] = 'email_order_paid_letter';
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_fe.php']['mailOrder'])) {
$params = array('this' => &$this, 'page' => &$page, 'content' => &$content, 'send_mail' => &$send_mail, 'user' => $user, 'order' => $order, 'order_details' => $ORDER_DETAILS, 'copy_to_merchant' => $copy_to_merchant, 'mail_attachment' => &$mail_attachment, 'loadFromPids' => $loadFromPids, 'add_invoice_attachment_on_templates' => &$add_invoice_attachment_on_templates);
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_fe.php']['mailOrder'] as $funcRef) {
\TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
}
}
if ($send_mail) {
if ($user['email']) {
if (in_array($mail_template, $add_invoice_attachment_on_templates) && $this->ms['MODULES']['ATTACH_INVOICE_PDF_IN_PAID_LETTER_EMAIL'] > 0) {
$filterInvoice = array();
$filterInvoice[] = 'orders_id=' . $order['orders_id'];
$invoices = mslib_befe::getRecords('', 'tx_multishop_invoices', '', $filterInvoice, '', 'id desc');
$invoice = $invoices[0];
$pdfFileName = $invoice['invoice_id'] . '_' . $invoice['orders_id'] . '.pdf';
$pdfFilePath = $this->DOCUMENT_ROOT . 'uploads/tx_multishop/tmp/' . $pdfFileName;
// generate the invoice PDF
// Get Language code (ie nl, en, de)
$language_code = mslib_befe::getLanguageIso2ByLanguageUid($order['language_id']);
$language_code = strtolower($language_code);
// Download invoice in the language of the order
$invoice_data = mslib_fe::file_get_contents($this->FULL_HTTP_URL . mslib_fe::typolink($this->shop_pid . ',2002', 'tx_multishop_pi1[page_section]=download_invoice&tx_multishop_pi1[hash]=' . $invoice['hash'] . '&tx_multishop_pi1[forceRecreate]=1&language=' . $language_code));
file_put_contents($pdfFilePath, $invoice_data);
$mail_attachment[] = $pdfFilePath;
}
mslib_fe::mailUser($user, $page[0]['name'], $page[0]['content'], $this->ms['MODULES']['STORE_EMAIL'], $this->ms['MODULES']['STORE_NAME'], $mail_attachment);
// moved to cleaning up section
//if (strpos($mail_template, 'email_order_paid_letter')!==false && $this->ms['MODULES']['ATTACH_INVOICE_PDF_IN_PAID_LETTER_EMAIL']>0 && file_exists($pdfFilePath)) {
// unlink($pdfFilePath);
//}
}
if ($copy_to_merchant) {
$mailSubject = '';
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_fe.php']['mailOrderToMerchant'])) {
$conf = array('this' => &$this, 'page' => &$page, 'content' => &$content, 'send_mail' => &$send_mail, 'user' => $user, 'order' => $order, 'order_details' => $ORDER_DETAILS, 'mail_attachment' => &$mail_attachment, 'mail_template' => $mail_template, 'psp_mail_template' => $psp_mail_template, 'loadFromPids' => $loadFromPids, 'mailSubject' => &$mailSubject, 'pageCopyToMerchant' => &$pageCopyToMerchant, 'array1' => &$array1, 'array2' => &$array2);
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_fe.php']['mailOrderToMerchant'] as $funcRef) {
\TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $conf, $this);
}
}
if ($pageCopyToMerchant[0]['content']) {
$pageCopyToMerchant[0]['content'] = str_replace($array1, $array2, $pageCopyToMerchant[0]['content']);
}
if ($pageCopyToMerchant[0]['name']) {
$pageCopyToMerchant[0]['name'] = str_replace($array1, $array2, $pageCopyToMerchant[0]['name']);
}
if ($mailSubject == '') {
$mailSubject = $this->pi_getLL('copy_for_merchant') . ': ' . $pageCopyToMerchant[0]['name'];
}
// now mail a copy to the merchant
$merchant = array();
$merchant['name'] = $this->ms['MODULES']['STORE_NAME'];
$merchant['email'] = $this->ms['MODULES']['STORE_EMAIL'];
mslib_fe::mailUser($merchant, $mailSubject, $pageCopyToMerchant[0]['content'], $this->ms['MODULES']['STORE_EMAIL'], $this->ms['MODULES']['STORE_NAME'], $mail_attachment);
if ($this->ms['MODULES']['SEND_ORDER_CONFIRMATION_LETTER_ALSO_TO']) {
$email = array();
if (!strstr($this->ms['MODULES']['SEND_ORDER_CONFIRMATION_LETTER_ALSO_TO'], ",")) {
$email[] = $this->ms['MODULES']['SEND_ORDER_CONFIRMATION_LETTER_ALSO_TO'];
} else {
$email = explode(',', $this->ms['MODULES']['SEND_ORDER_CONFIRMATION_LETTER_ALSO_TO']);
}
if (count($email)) {
foreach ($email as $item) {
$merchant = array();
$merchant['name'] = $this->ms['MODULES']['STORE_NAME'];
$merchant['email'] = $item;
mslib_fe::mailUser($merchant, $mailSubject, $pageCopyToMerchant[0]['content'], $this->ms['MODULES']['STORE_EMAIL'], $this->ms['MODULES']['STORE_NAME'], $mail_attachment);
}
}
}
}
// cleaning up the temporary attachment files
if (is_array($mail_attachment) && count($mail_attachment)) {
foreach ($mail_attachment as $filepath) {
if (strpos($filepath, 'tx_multishop/tmp') !== false) {
if (file_exists($filepath)) {
@unlink($filepath);
}
}
}
}
}
}
if (isset($order['language_id'])) {
// Switch back to default language
mslib_befe::resetSystemLanguage();
}
return 1;
}
}
示例6: header
if (file_exists($combinedPdfFile)) {
header("Content-type:application/pdf");
readfile($combinedPdfFile);
// delete temporary invoice from disk
unlink($combinedPdfFile);
foreach ($attachments as $attachment) {
unlink($attachment);
}
exit;
}
break;
case 'mail_selected_invoices_to_merchant':
$user = array();
$user['name'] = $this->ms['MODULES']['STORE_NAME'];
$user['email'] = $this->ms['MODULES']['STORE_EMAIL'];
if (mslib_fe::mailUser($user, $this->ms['MODULES']['STORE_NAME'] . ' invoices', $this->ms['MODULES']['STORE_NAME'] . ' invoices', $this->ms['MODULES']['STORE_EMAIL'], $this->ms['MODULES']['STORE_NAME'], array($combinedPdfFile))) {
$postErno[] = array('status' => 'info', 'message' => 'The following invoices are mailed to ' . $user['email'] . ':<ul><li>' . implode('</li><li>', array_keys($attachments)) . '</li></ul>');
} else {
$postErno[] = array('status' => 'error', 'message' => 'Failed to mail invoices to: ' . $user['email']);
}
break;
}
// delete temporary invoice from disk
unlink($combinedPdfFile);
foreach ($attachments as $attachment) {
unlink($attachment);
}
} else {
echo 'gs binary cannot be found. This is needed for merging multiple PDF files as one file.';
exit;
}