本文整理汇总了PHP中email::build_message方法的典型用法代码示例。如果您正苦于以下问题:PHP email::build_message方法的具体用法?PHP email::build_message怎么用?PHP email::build_message使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类email
的用法示例。
在下文中一共展示了email::build_message方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: send
function send($affiliate_newsletter_id)
{
$mail_query = tep_db_query("select affiliate_firstname, affiliate_lastname, affiliate_email_address from " . TABLE_AFFILIATE . " where affiliate_newsletter = '1'");
$mimemessage = new email(array('X-Mailer: osCmax Mailer'));
$mimemessage->add_text($this->content);
$mimemessage->build_message();
while ($mail = tep_db_fetch_array($mail_query)) {
$mimemessage->send($mail['affiliate_firstname'] . ' ' . $mail['affiliate_lastname'], $mail['affiliate_email_address'], '', EMAIL_FROM, $this->title);
}
$affiliate_newsletter_id = tep_db_prepare_input($affiliate_newsletter_id);
tep_db_query("update " . TABLE_AFFILIATE_NEWSLETTERS . " set date_sent = now(), status = '1' where affiliate_newsletters_id = '" . tep_db_input($affiliate_newsletter_id) . "'");
}
示例2: send
function send($newsletter_id)
{
$mail_query = smn_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_newsletter = '1'");
$mimemessage = new email(array('X-Mailer: oscMall bulk mailer'));
$mimemessage->add_html($this->content);
$mimemessage->build_message();
while ($mail = smn_db_fetch_array($mail_query)) {
$mimemessage->send($mail['customers_firstname'] . ' ' . $mail['customers_lastname'], $mail['customers_email_address'], '', EMAIL_FROM, $this->title);
}
$newsletter_id = smn_db_prepare_input($newsletter_id);
smn_db_query("update " . TABLE_NEWSLETTERS . " set date_sent = now(), status = '1' where newsletters_id = '" . smn_db_input($newsletter_id) . "'");
}
示例3: send
function send($newsletter_id)
{
$mail_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_newsletter = '1'");
while ($mail = tep_db_fetch_array($mail_query)) {
$mimemessage = new email(array('X-Mailer: osCommerce bulk mailer'));
// Préparation de l'envoie du mail en HTML
$mimemessage->add_html_newsletter($this->header . "\n\n" . $this->content . "\n\n" . $this->unsubscribea . " " . '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_UNSUBSCRIBE . "?email=" . $mail['customers_email_address'] . '">' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_UNSUBSCRIBE . "?email=" . $mail['customers_email_address'] . '</a>' . "\n\n" . $this->unsubscribeb);
$mimemessage->build_message();
// ################# END - Contribution Newsletter v050 ##############
$mimemessage->send($mail['customers_firstname'] . ' ' . $mail['customers_lastname'], $mail['customers_email_address'], '', EMAIL_FROM, $this->title);
}
$newsletter_id = tep_db_prepare_input($newsletter_id);
tep_db_query("update " . TABLE_NEWSLETTERS . " set date_sent = now(), status = '1' where newsletters_id = '" . tep_db_input($newsletter_id) . "'");
}
示例4: tep_mail
function tep_mail($to_name, $to_email_address, $email_subject, $email_text, $from_email_name, $from_email_address, $html_email = false)
{
// Instantiate a new mail object
$message = new email(array('X-Mailer: E-goldexJp Mailer'));
// Build the text version
$text = strip_tags($email_text);
// edit by donghp 27/03/2012
if ($html_email) {
$message->add_html($email_text, $text);
} else {
$message->add_text($text);
}
// Send message
$message->build_message();
$message->send($to_name, $to_email_address, $from_email_name, $from_email_address, $email_subject);
}
示例5: send
function send($newsletter_id)
{
$mail_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_newsletter = '1'");
$mimemessage = new email(array('X-Mailer: osCommerce'));
// Build the text version
$text = strip_tags($this->content);
if (EMAIL_USE_HTML == 'true') {
$mimemessage->add_html($this->content, $text);
} else {
$mimemessage->add_text($text);
}
$mimemessage->build_message();
while ($mail = tep_db_fetch_array($mail_query)) {
$mimemessage->send($mail['customers_firstname'] . ' ' . $mail['customers_lastname'], $mail['customers_email_address'], '', EMAIL_FROM, $this->title);
}
$newsletter_id = tep_db_prepare_input($newsletter_id);
tep_db_query("update " . TABLE_NEWSLETTERS . " set date_sent = now(), status = '1' where newsletters_id = '" . tep_db_input($newsletter_id) . "'");
}
示例6: send
function send($newsletter_id)
{
$mail_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_newsletter = '1'");
$mimemessage = new email(array('X-Mailer: osCmax Mailer'));
// BOF: MOD - WYSIWYG HTML Area (Send TEXT Newsletter v1.7 when WYSIWYG Disabled)
if (HTML_AREA_WYSIWYG_DISABLE_NEWSLETTER == 'Disable') {
$mimemessage->add_text($this->content);
// orginal OSC line
} else {
$mimemessage->add_html($this->content);
}
// EOF: MOD - WYSIWYG HTML Area (Send TEXT Newsletter v1.7 when WYSIWYG Disabled)
$mimemessage->build_message();
while ($mail = tep_db_fetch_array($mail_query)) {
$mimemessage->send($mail['customers_firstname'] . ' ' . $mail['customers_lastname'], $mail['customers_email_address'], '', EMAIL_FROM, $this->title);
}
$newsletter_id = tep_db_prepare_input($newsletter_id);
tep_db_query("update " . TABLE_NEWSLETTERS . " set date_sent = now(), status = '1' where newsletters_id = '" . tep_db_input($newsletter_id) . "'");
}
示例7: email_now
function email_now($t_key, $tpl, $extra, $lang = NULL)
{
if (SEND_EMAILS != 'true') {
return false;
}
if (!isset($lang) || !$lang) {
$lang = $language;
}
$tpquery = tep_db_query("SELECT * FROM email_now_templates WHERE email_template_key='{$t_key}' ORDER BY language_id!='{$lang}',language_id LIMIT 1");
if ($tpinfo = tep_db_fetch_array($tpquery)) {
$message = new email(array('X-Mailer: IntenseCart'));
if (EMAIL_USE_HTML == 'true' && $tpinfo['send_mode'] == 'html') {
$message->add_html(email_now_expand($tpinfo['email_template_html'], $tpl, 'html', ' '), email_now_expand($tpinfo['email_template_text'], $tpl));
} else {
$message->add_text(email_now_expand($tpinfo['email_template_text'], $tpl));
}
// # Send message
$message->build_message();
$to_name = email_now_expand($tpinfo['to_name'], $tpl, 'text', ' ');
$to_email = email_now_expand($tpinfo['to_email'], $tpl, 'text', ' ');
$from_name = email_now_expand($tpinfo['from_name'], $tpl, 'text', ' ');
$from_email = email_now_expand($tpinfo['from_email'], $tpl, 'text', ' ');
$subj = email_now_expand($tpinfo['email_subject'], $tpl, 'text', ' ');
if (!empty($to_name)) {
$message->send($to_name, $to_email, $from_name, $from_email, $subj);
if (is_array($extra)) {
foreach ($extra as $cc) {
$ar = array();
if (preg_match('/^\\s*(.*?)\\s*<\\s*(.*?)\\s*>/', $cc, $ar)) {
$cc_name = $ar[1];
$cc_email = $ar[2];
} else {
$cc_name = '';
$cc_email = $cc;
}
$message->send($cc_name, $cc_email, $from_name, $from_email, $subj . " [Fwd: {$to_name} <{$to_email}>]");
}
}
}
} else {
return false;
}
}
示例8: sendEmail
function sendEmail()
{
if (PHP_VERSION < 4.1) {
global $_GET;
}
global $osC_Database;
$max_execution_time = 0.8 * (int) ini_get('max_execution_time');
$time_start = explode(' ', PAGE_PARSE_START_TIME);
$Qrecipients = $osC_Database->query('select c.customers_firstname, c.customers_lastname, c.customers_email_address from :table_customers c left join :table_newsletters_log nl on (c.customers_email_address = nl.email_address and nl.newsletters_id = :newsletters_id) where c.customers_newsletter = 1 and nl.email_address is null');
$Qrecipients->bindTable(':table_customers', TABLE_CUSTOMERS);
$Qrecipients->bindTable(':table_newsletters_log', TABLE_NEWSLETTERS_LOG);
$Qrecipients->bindInt(':newsletters_id', $this->_newsletter_id);
$Qrecipients->execute();
if ($Qrecipients->numberOfRows() > 0) {
$mimemessage = new email(array(base64_decode('WC1NYWlsZXI6IG9zQ29tbWVyY2UgKGh0dHA6Ly93d3cub3Njb21tZXJjZS5jb20p')));
$mimemessage->add_text($this->_newsletter_content);
$mimemessage->build_message();
while ($Qrecipients->next()) {
$mimemessage->send($Qrecipients->value('customers_firstname') . ' ' . $Qrecipients->value('customers_lastname'), $Qrecipients->value('customers_email_address'), '', EMAIL_FROM, $this->_newsletter_title);
$Qlog = $osC_Database->query('insert into :table_newsletters_log (newsletters_id, email_address, date_sent) values (:newsletters_id, :email_address, now())');
$Qlog->bindTable(':table_newsletters_log', TABLE_NEWSLETTERS_LOG);
$Qlog->bindInt(':newsletters_id', $this->_newsletter_id);
$Qlog->bindValue(':email_address', $Qrecipients->value('customers_email_address'));
$Qlog->execute();
$time_end = explode(' ', microtime());
$timer_total = number_format($time_end[1] + $time_end[0] - ($time_start[1] + $time_start[0]), 3);
if ($timer_total > $max_execution_time) {
echo '<p><font color="#38BB68"><b>' . TEXT_REFRESHING_PAGE . '</b></font></p>' . '<p><a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $_GET['page'] . '&nmID=' . $this->_newsletter_id . '&action=nmSendConfirm') . '">' . TEXT_CONTINUE_MANUALLY . '</a></p>' . '<META HTTP-EQUIV="refresh" content="2; URL=' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $_GET['page'] . '&nmID=' . $this->_newsletter_id . '&action=nmSendConfirm') . '">';
exit;
}
}
$Qrecipients->freeResult();
}
$Qupdate = $osC_Database->query('update :table_newsletters set date_sent = now(), status = 1 where newsletters_id = :newsletters_id');
$Qupdate->bindTable(':table_newsletters', TABLE_NEWSLETTERS);
$Qupdate->bindInt(':newsletters_id', $this->_newsletter_id);
$Qupdate->execute();
}
示例9: tep_mail
function tep_mail($to_name, $to_email_address, $email_subject, $email_text, $from_email_name, $from_email_address)
{
if (SEND_EMAILS != 'true') {
return false;
}
// Instantiate a new mail object
$message = new email(array('X-Mailer: osCommerce'));
// Build the text version
$text = strip_tags($email_text);
if (EMAIL_USE_HTML == 'true') {
$message->add_html($email_text, $text);
} else {
$message->add_text($text);
}
// Send message
$message->build_message();
$message->send($to_name, $to_email_address, $from_email_name, $from_email_address, $email_subject);
}
示例10: email
$mail_sent_to = $sent_to['customers_status_name'];
} else {
$customers_email_address = olc_db_prepare_input($_POST['customers_email_address']);
$mail_query = olc_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_email_address = '" . olc_db_input($customers_email_address) . APOS);
$mail_sent_to = $_POST['customers_email_address'];
}
break;
}
$from = olc_db_prepare_input($_POST['from']);
$subject = olc_db_prepare_input($_POST['subject']);
$message = olc_db_prepare_input($_POST['message']);
//Let's build a message object using the email class
$mimemessage = new email(array('X-Mailer: OL-Commerce bulk mailer'));
// add the message to the object
$mimemessage->add_text($message);
$mimemessage->build_message();
while ($mail = olc_db_fetch_array($mail_query)) {
$mimemessage->send($mail['customers_firstname'] . BLANK . $mail['customers_lastname'], $mail['customers_email_address'], '', $from, $subject);
}
olc_redirect(olc_href_link(FILENAME_MAIL, 'mail_sent_to=' . urlencode($mail_sent_to)));
}
if ($_GET['action'] == 'preview' && !$_POST['customers_email_address']) {
$messageStack->add(ERROR_NO_CUSTOMER_SELECTED, 'error');
}
if ($_GET['mail_sent_to']) {
$messageStack->add(sprintf(NOTICE_EMAIL_SENT_TO, $_GET['mail_sent_to']), 'notice');
}
require DIR_WS_INCLUDES . 'header.php';
?>
<table border="0" width="100%" cellspacing="2" cellpadding="2">
<tr>
示例11: zen_mail
//.........这里部分代码省略.........
//define some additional html message blocks available to templates, then build the html portion.
if ($block['EMAIL_TO_NAME'] == '') {
$block['EMAIL_TO_NAME'] = $to_name;
}
if ($block['EMAIL_TO_ADDRESS'] == '') {
$block['EMAIL_TO_ADDRESS'] = $to_email_address;
}
if ($block['EMAIL_SUBJECT'] == '') {
$block['EMAIL_SUBJECT'] = $email_subject;
}
if ($block['EMAIL_FROM_NAME'] == '') {
$block['EMAIL_FROM_NAME'] = $from_email_name;
}
if ($block['EMAIL_FROM_ADDRESS'] == '') {
$block['EMAIL_FROM_ADDRESS'] = $from_email_address;
}
$email_html = zen_build_html_email_from_template($module, $block);
// if ($attachments_list == '') $attachments_list= array();
// Instantiate a new mail object
$message = new email(array('X-Mailer: Zen Cart Mailer'));
// bof: body of the email clean-up
// clean up & and && from email text
while (strstr($email_text, '&&')) {
$email_text = str_replace('&&', '&', $email_text);
}
while (strstr($email_text, '&')) {
$email_text = str_replace('&', '&', $email_text);
}
while (strstr($email_text, '&&')) {
$email_text = str_replace('&&', '&', $email_text);
}
// clean up money € to e
while (strstr($email_text, '€')) {
$email_text = str_replace('€', 'e', $email_text);
}
// fix double quotes
while (strstr($email_text, '"')) {
$email_text = str_replace('"', '"', $email_text);
}
// fix slashes
$email_text = stripslashes($email_text);
$email_html = stripslashes($email_html);
// eof: body of the email clean-up
//determine customer's email preference type: HTML or TEXT-ONLY (HTML assumed if not specified)
$customers_email_format_read = $db->Execute("select customers_email_format from " . TABLE_CUSTOMERS . " where customers_email_address= '" . $to_email_address . "'");
$customers_email_format = $customers_email_format_read->fields['customers_email_format'];
if ($customers_email_format == 'NONE' || $customers_email_format == 'OUT') {
return;
}
//if requested no mail, then don't send.
if ($customers_email_format == 'HTML') {
$customers_email_format = 'HTML';
}
// if they opted-in to HTML messages, then send HTML format
//determine what format to send messages in if this is an "extra"/admin-copy email:
if (ADMIN_EXTRA_EMAIL_FORMAT == 'TEXT' && substr($module, -6) == '_extra') {
$email_html = '';
// just blank out the html portion if admin has selected text-only
}
// Build the email based on whether customer has selected HTML or TEXT, and whether we have supplied HTML or TEXT-only components
if (!zen_not_null($email_text)) {
$text = str_replace('<br[[:space:]]*/?[[:space:]]*>', "@CRLF", $block['EMAIL_MESSAGE_HTML']);
$text = str_replace('</p>', '</p>@CRLF', $text);
$text = htmlspecialchars(stripslashes(strip_tags($text)));
} else {
$text = strip_tags($email_text);
}
if (EMAIL_USE_HTML == 'true' && trim($email_html) != '' && ($customers_email_format == 'HTML' || ADMIN_EXTRA_EMAIL_FORMAT != 'TEXT' && substr($module, -6) == '_extra')) {
$message->add_html($email_html, $text);
} else {
$message->add_text($text);
$email_html = '';
// since sending a text-only message, empty the HTML portion so it's not archived either.
}
// process attachments
if (EMAIL_ATTACHMENTS_ENABLED && zen_not_null($attachments_list)) {
// while ( list($key, $value) = each($attachments_list)) {
$fileraw = $message->get_file(DIR_FS_ADMIN . 'attachments/' . $attachments_list['file']);
$filemime = zen_not_null($attachments_list['file_type']) ? $attachments_list['file_type'] : $message->findMime($attachments_list);
//findMime determines what type this attachment is (XLS, PDF, etc) and sends proper vendor c_type.
$message->add_attachment($fileraw, $attachments_list['file'], $filemime);
// } //endwhile attach_list
}
//endif attachments
// Prepare message
$message->build_message();
// send the actual email
$result = $message->send($to_name, $to_email_address, $from_email_name, $from_email_address, $email_subject);
if (!$result) {
$messageStack->add(sprintf(EMAIL_SEND_FAILED, $to_name, $to_email_address, $email_subject), 'error');
}
// Archive this message to storage log
if (EMAIL_ARCHIVE == 'true' && $module != 'password_forgotten_admin' && $module != 'cc_middle_digs') {
// don't archive pwd-resets and CC numbers
zen_mail_archive_write($to_name, $to_email_address, $from_email_name, $from_email_address, $email_subject, $email_html, $text, $module);
}
// endif archiving
}
// end foreach loop thru possible multiple email addresses
}
示例12: send
function send($newsletter_id)
{
$audience = array();
if ($_POST['global'] == TRUE_STRING_S) {
$products_query = olc_db_query("select distinct pn.customers_id, c.customers_firstname, c.customers_lastname, c.customers_email_address from " . TABLE_CUSTOMERS . " c, " . TABLE_PRODUCTS_NOTIFICATIONS . " pn where c.customers_id = pn.customers_id");
while ($products = olc_db_fetch_array($products_query)) {
$audience[$products['customers_id']] = array('firstname' => $products['customers_firstname'], 'lastname' => $products['customers_lastname'], 'email_address' => $products['customers_email_address']);
}
$customers_query = olc_db_query("select c.customers_id, c.customers_firstname, c.customers_lastname, c.customers_email_address from " . TABLE_CUSTOMERS . " c, " . TABLE_CUSTOMERS_INFO . " ci where c.customers_id = ci.customers_info_id and ci.global_product_notifications = '1'");
while ($customers = olc_db_fetch_array($customers_query)) {
$audience[$customers['customers_id']] = array('firstname' => $customers['customers_firstname'], 'lastname' => $customers['customers_lastname'], 'email_address' => $customers['customers_email_address']);
}
} else {
$chosen = $_POST['chosen'];
$ids = implode(',', $chosen);
$products_query = olc_db_query("select distinct pn.customers_id, c.customers_firstname, c.customers_lastname, c.customers_email_address from " . TABLE_CUSTOMERS . " c, " . TABLE_PRODUCTS_NOTIFICATIONS . " pn where c.customers_id = pn.customers_id and pn.products_id in (" . $ids . RPAREN);
while ($products = olc_db_fetch_array($products_query)) {
$audience[$products['customers_id']] = array('firstname' => $products['customers_firstname'], 'lastname' => $products['customers_lastname'], 'email_address' => $products['customers_email_address']);
}
$customers_query = olc_db_query("select c.customers_id, c.customers_firstname, c.customers_lastname, c.customers_email_address from " . TABLE_CUSTOMERS . " c, " . TABLE_CUSTOMERS_INFO . " ci where c.customers_id = ci.customers_info_id and ci.global_product_notifications = '1'");
while ($customers = olc_db_fetch_array($customers_query)) {
$audience[$customers['customers_id']] = array('firstname' => $customers['customers_firstname'], 'lastname' => $customers['customers_lastname'], 'email_address' => $customers['customers_email_address']);
}
}
$mimemessage = new email(array('X-Mailer: osCommerce bulk mailer'));
$mimemessage->add_text($this->content);
$mimemessage->build_message();
reset($audience);
while (list($key, $value) = each($audience)) {
$mimemessage->send($value['firstname'] . BLANK . $value['lastname'], $value['email_address'], '', EMAIL_FROM, $this->title);
}
$newsletter_id = olc_db_prepare_input($newsletter_id);
olc_db_query(SQL_UPDATE . TABLE_NEWSLETTERS . " set date_sent = now(), status = '1' where newsletters_id = '" . olc_db_input($newsletter_id) . APOS);
}
示例13: tep_update_all_shops
//.........这里部分代码省略.........
} else {
$product_email_name = (tep_not_null($author_info['authors_name']) ? $author_info['authors_name'] . ': ' : '') . $product_name_info['products_name'];
}
$new_status = $new_info['products_listing_status'];
$new_price = $new_info['products_price'];
$old_status = $old_info['products_listing_status'];
$old_price = $old_info['products_price'];
$customer_info_query = tep_db_query("select customers_firstname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_id = '" . (int) $notify_products['customers_id'] . "'");
$customer_info = tep_db_fetch_array($customer_info_query);
$notification_body = '';
$notification_subject = '';
$notification_warning = '';
if ($notify_products['customers_basket_notify'] == '1') {
// о появлении в продаже
if ($new_status == '1') {
if ($lang_id == 1) {
$notification_body = EMAIL_NOTIFICATION_BODY_EN_1;
$notification_subject = EMAIL_NOTIFICATION_SUBJECT_EN_1;
$notification_warning = EMAIL_NOTIFICATION_WARNING_EN_1;
} else {
$notification_body = EMAIL_NOTIFICATION_BODY_1;
$notification_subject = EMAIL_NOTIFICATION_SUBJECT_1;
$notification_warning = EMAIL_NOTIFICATION_WARNING_1;
}
}
} elseif ($notify_products['customers_basket_notify'] == '2') {
// о снижении цены
if ($new_price > 0 && $new_price < $old_price) {
if ($lang_id == 1) {
$notification_body = EMAIL_NOTIFICATION_BODY_EN_2;
$notification_subject = EMAIL_NOTIFICATION_SUBJECT_EN_2;
$notification_warning = EMAIL_NOTIFICATION_WARNING_EN_2;
} else {
$notification_body = EMAIL_NOTIFICATION_BODY_2;
$notification_subject = EMAIL_NOTIFICATION_SUBJECT_2;
$notification_warning = EMAIL_NOTIFICATION_WARNING_2;
}
}
}
if (tep_not_null($notification_body)) {
$email_notification_body = str_replace('{{product_link}}', $notify_products['customers_basket_notify_url'], sprintf($notification_body, $customer_info['customers_firstname'], $product_email_name)) . "\n\n" . EMAIL_NOTIFICATION_SEPARATOR . "\n" . sprintf($notification_warning, $shop_name);
$message = new email(array('X-Mailer: ' . $shop_name));
$text = strip_tags($email_notification_body);
if ($shops['shops_email_use_html'] < 1) {
$message->add_text($text);
} else {
ob_start();
include DIR_FS_CATALOG . 'images/mail/email_header_1.php';
echo trim($email_notification_body);
include DIR_FS_CATALOG . 'images/mail/email_footer_1.php';
$email_text_html = ob_get_clean();
$email_text_html = str_replace(array('<title></title>', '{{HTTP_SERVER}}', '{{STORE_NAME}}', '{{STORE_OWNER_PHONE_NUMBER}}'), array('<title>' . sprintf($notification_subject, $shop_name) . '</title>', $shops['shops_url'], $shop_name, $shop_phone), $email_text_html);
$message->add_html($email_text_html, $text);
}
$message->build_message();
$message->send($customer_info['customers_firstname'], $customer_info['customers_email_address'], $shop_name, $shop_email, sprintf($notification_subject, $shop_name));
tep_db_query("update " . TABLE_CUSTOMERS_BASKET . " set customers_basket_notify = '0', customers_basket_notify_url = null where customers_basket_id = '" . (int) $notify_products['customers_basket_id'] . "'");
}
}
}
tep_db_query("drop table " . $shop_db . "." . $temp_table . "");
tep_db_query("alter table " . $shop_db . ".temp_" . $temp_table . " rename as " . $shop_db . "." . $temp_table . "");
if ($shop_db == 'setbook_ua') {
tep_db_query("update " . $shop_db . "." . TABLE_CURRENCIES . " set value = '" . tep_db_input($temp_currencies[$shop_currency]) . "', last_updated = now() where code = '" . tep_db_input($shop_currency) . "'");
}
}
}
if ($shops['shops_default_status'] == '1') {
tep_db_query("delete from " . TABLE_SEARCH_KEYWORDS_TO_PRODUCTS . "");
tep_db_query("delete from " . TABLE_SEARCH_KEYWORDS . "");
tep_db_query("update " . TABLE_SPECIALS_TYPES . " set specials_last_modified = now()");
}
if ($products_types_default_status == 1) {
tep_db_query("update " . $shop_db . "." . TABLE_PRODUCTS_TYPES . " set products_last_modified = now() where products_types_id = '1'");
} else {
tep_db_query("update " . $shop_db . "." . TABLE_PRODUCTS_TYPES . " set products_last_modified = now() where products_types_id > '1'");
}
if ($shop_db == 'setbook_us' || $shop_db == 'setbook_biz') {
tep_db_query("replace into " . $shop_db . "." . TABLE_METATAGS . " (metatags_page_title, metatags_title, metatags_keywords, metatags_description, language_id, content_type, content_id) select concat_ws('', " . DB_DATABASE . "." . TABLE_METATAGS . ".metatags_page_title, ' Russian books.'), concat_ws('', " . DB_DATABASE . "." . TABLE_METATAGS . ".metatags_title, '. Russian books.'), concat_ws('', " . DB_DATABASE . "." . TABLE_METATAGS . ".metatags_keywords, ' Russian books.'), concat_ws('', " . DB_DATABASE . "." . TABLE_METATAGS . ".metatags_description, ' Russian books.'), " . DB_DATABASE . "." . TABLE_METATAGS . ".language_id, " . DB_DATABASE . "." . TABLE_METATAGS . ".content_type, " . DB_DATABASE . "." . TABLE_METATAGS . ".content_id from " . DB_DATABASE . "." . TABLE_METATAGS . " where " . DB_DATABASE . "." . TABLE_METATAGS . ".content_type in ('author', 'category', 'manufacturer', 'product', 'serie', 'type');");
tep_db_query("update " . $shop_db . "." . TABLE_METATAGS . " mt, " . $shop_db . "." . TABLE_PRODUCTS . " p set mt.metatags_page_title = replace(mt.metatags_page_title, 'Russian books', 'Russian magazines'), mt.metatags_title = replace(mt.metatags_title, 'Russian books', 'Russian magazines'), mt.metatags_keywords = replace(mt.metatags_keywords, 'Russian books', 'Russian magazines'), mt.metatags_description = replace(mt.metatags_description, 'Russian books', 'Russian magazines') where mt.content_type = 'product' and mt.content_id = p.products_id and p.products_types_id = '2'");
tep_db_query("update " . $shop_db . "." . TABLE_METATAGS . " mt, " . $shop_db . "." . TABLE_PRODUCTS . " p set mt.metatags_page_title = replace(mt.metatags_page_title, 'Russian books', 'Russian magazines'), mt.metatags_title = replace(mt.metatags_title, 'Russian books', 'Russian souvenirs. Matreshka'), mt.metatags_keywords = replace(mt.metatags_keywords, 'Russian books', 'Russian magazines'), mt.metatags_description = replace(mt.metatags_description, 'Russian books', 'Russian souvenirs') where mt.content_type = 'product' and mt.content_id = p.products_id and p.products_types_id = '5'");
} elseif ($shop_db == 'setbook_eu' || $shop_db == 'setbook_net') {
tep_db_query("replace into " . $shop_db . "." . TABLE_METATAGS . " (metatags_page_title, metatags_title, metatags_keywords, metatags_description, language_id, content_type, content_id) select concat_ws('', " . DB_DATABASE . "." . TABLE_METATAGS . ".metatags_page_title, ' Russian books. Russische bücher'), concat_ws('', " . DB_DATABASE . "." . TABLE_METATAGS . ".metatags_title, '. Russian books.'), concat_ws('', " . DB_DATABASE . "." . TABLE_METATAGS . ".metatags_keywords, ' Russian books. Russische bücher'), concat_ws('', " . DB_DATABASE . "." . TABLE_METATAGS . ".metatags_description, ' Russian books. Russische bücher'), " . DB_DATABASE . "." . TABLE_METATAGS . ".language_id, " . DB_DATABASE . "." . TABLE_METATAGS . ".content_type, " . DB_DATABASE . "." . TABLE_METATAGS . ".content_id from " . DB_DATABASE . "." . TABLE_METATAGS . " where " . DB_DATABASE . "." . TABLE_METATAGS . ".content_type in ('author', 'category', 'manufacturer', 'product', 'serie', 'type');");
tep_db_query("update " . $shop_db . "." . TABLE_METATAGS . " mt, " . $shop_db . "." . TABLE_PRODUCTS . " p set mt.metatags_page_title = replace(mt.metatags_page_title, 'Russian books. Russische bücher', 'Russian magazines. Russische Zeitschriften'), mt.metatags_title = replace(mt.metatags_title, 'Russian books', 'Russian magazines'), mt.metatags_keywords = replace(mt.metatags_keywords, 'Russian books', 'Russian magazines'), mt.metatags_description = replace(mt.metatags_description, 'Russian books', 'Russian magazines') where mt.content_type = 'product' and mt.content_id = p.products_id and p.products_types_id = '2'");
} elseif ($shop_db == 'setbook_ua') {
tep_db_query("replace into " . $shop_db . "." . TABLE_METATAGS . " (metatags_page_title, metatags_title, metatags_keywords, metatags_description, language_id, content_type, content_id) select replace(" . DB_DATABASE . "." . TABLE_METATAGS . ".metatags_page_title, 'Интернет-магазин Setbook', 'Книжный интернет-магазин в Украине Setbook'), concat_ws('', " . DB_DATABASE . "." . TABLE_METATAGS . ".metatags_title, '. Книжный интернет-магазин в Украине Setbook.'), concat_ws('', " . DB_DATABASE . "." . TABLE_METATAGS . ".metatags_keywords, ' Украина, книги в Киеве.'),\nconcat_ws('', " . DB_DATABASE . "." . TABLE_METATAGS . ".metatags_description, ' Украина, книги в Киеве.'), " . DB_DATABASE . "." . TABLE_METATAGS . ".language_id, " . DB_DATABASE . "." . TABLE_METATAGS . ".content_type, " . DB_DATABASE . "." . TABLE_METATAGS . ".content_id from " . DB_DATABASE . "." . TABLE_METATAGS . " where " . DB_DATABASE . "." . TABLE_METATAGS . ".content_type in ('author', 'category', 'manufacturer', 'product', 'serie', 'type');");
// tep_db_query("update " . $shop_db . "." . TABLE_METATAGS . " mt, " . $shop_db . "." . TABLE_PRODUCTS . " p set mt.metatags_page_title = replace(mt.metatags_page_title, 'Russian books', ''), mt.metatags_title = replace(mt.metatags_title, '', ''), mt.metatags_keywords = replace(mt.metatags_keywords, '', ''), mt.metatags_description = replace(mt.metatags_description, '', '') where mt.content_type = 'product' and mt.content_id = p.products_id and p.products_types_id = '2'");
} elseif ($shop_db == 'setbook_kz') {
tep_db_query("replace into " . $shop_db . "." . TABLE_METATAGS . " (metatags_page_title, metatags_title, metatags_keywords, metatags_description, language_id, content_type, content_id) select replace(" . DB_DATABASE . "." . TABLE_METATAGS . ".metatags_page_title, 'Интернет-магазин Setbook', 'Книжный интернет-магазин в Казахстане Setbook'), concat_ws('', " . DB_DATABASE . "." . TABLE_METATAGS . ".metatags_title, '. Книжный интернет-магазин в Казахстане Setbook.'), concat_ws('', " . DB_DATABASE . "." . TABLE_METATAGS . ".metatags_keywords, ' Казахстан, книги в Алматы, Астане, Караганде.'),\nconcat_ws('', " . DB_DATABASE . "." . TABLE_METATAGS . ".metatags_description, ' Казахстан, книги в Алматы, Астане, Караганде.'), " . DB_DATABASE . "." . TABLE_METATAGS . ".language_id, " . DB_DATABASE . "." . TABLE_METATAGS . ".content_type, " . DB_DATABASE . "." . TABLE_METATAGS . ".content_id from " . DB_DATABASE . "." . TABLE_METATAGS . " where " . DB_DATABASE . "." . TABLE_METATAGS . ".content_type in ('author', 'category', 'manufacturer', 'product', 'serie', 'type');");
// tep_db_query("update " . $shop_db . "." . TABLE_METATAGS . " mt, " . $shop_db . "." . TABLE_PRODUCTS . " p set mt.metatags_page_title = replace(mt.metatags_page_title, 'Russian books', ''), mt.metatags_title = replace(mt.metatags_title, '', ''), mt.metatags_keywords = replace(mt.metatags_keywords, '', ''), mt.metatags_description = replace(mt.metatags_description, '', '') where mt.content_type = 'product' and mt.content_id = p.products_id and p.products_types_id = '2'");
} elseif ($shop_db == 'setbook_by' || $shop_db == 'bookva_by') {
if ($shop_db == 'setbook_by') {
tep_db_query("replace into " . $shop_db . "." . TABLE_METATAGS . " (metatags_page_title, metatags_title, metatags_keywords, metatags_description, language_id, content_type, content_id) select replace(" . DB_DATABASE . "." . TABLE_METATAGS . ".metatags_page_title, 'Интернет-магазин Setbook', 'Интернет-магазин книг в Белоруссии Setbook'), concat_ws('', " . DB_DATABASE . "." . TABLE_METATAGS . ".metatags_title, '. Интернет-магазин книг Белоруссии Setbook.'), concat_ws('', " . DB_DATABASE . "." . TABLE_METATAGS . ".metatags_keywords, ' Белоруссия, книги в Минске.'), concat_ws('', " . DB_DATABASE . "." . TABLE_METATAGS . ".metatags_description, ' Белоруссия, книги в Минске.'), " . DB_DATABASE . "." . TABLE_METATAGS . ".language_id, " . DB_DATABASE . "." . TABLE_METATAGS . ".content_type, " . DB_DATABASE . "." . TABLE_METATAGS . ".content_id from " . DB_DATABASE . "." . TABLE_METATAGS . " where " . DB_DATABASE . "." . TABLE_METATAGS . ".content_type in ('author', 'category', 'manufacturer', 'product', 'serie', 'type');");
// tep_db_query("update " . $shop_db . "." . TABLE_METATAGS . " mt, " . $shop_db . "." . TABLE_PRODUCTS . " p set mt.metatags_page_title = replace(mt.metatags_page_title, 'Russian books', ''), mt.metatags_title = replace(mt.metatags_title, '', ''), mt.metatags_keywords = replace(mt.metatags_keywords, '', ''), mt.metatags_description = replace(mt.metatags_description, '', '') where mt.content_type = 'product' and mt.content_id = p.products_id and p.products_types_id = '2'");
}
}
}
}
tep_db_select_db(DB_DATABASE);
}
示例14: sendEmail
function sendEmail()
{
if (PHP_VERSION < 4.1) {
global $_GET, $_POST;
}
global $osC_Database;
$max_execution_time = 0.8 * (int) ini_get('max_execution_time');
$time_start = explode(' ', PAGE_PARSE_START_TIME);
if (isset($_POST['chosen'])) {
$chosen = $_POST['chosen'];
} elseif (isset($_GET['chosen'])) {
$chosen = $_GET['chosen'];
} elseif (isset($_POST['global'])) {
$global = $_POST['global'];
} elseif (isset($_GET['global'])) {
$global = $_GET['global'];
}
$chosen_get_string = '';
if (isset($chosen) && !empty($chosen)) {
foreach ($chosen as $id) {
$chosen_get_string .= 'chosen[]=' . $id . '&';
}
}
$audience = array();
$Qcustomers = $osC_Database->query('select c.customers_id, c.customers_firstname, c.customers_lastname, c.customers_email_address from :table_customers c, :table_customers_info ci where ci.global_product_notifications = 1 and ci.customers_info_id = c.customers_id');
$Qcustomers->bindTable(':table_customers', TABLE_CUSTOMERS);
$Qcustomers->bindTable(':table_customers_info', TABLE_CUSTOMERS_INFO);
$Qcustomers->execute();
while ($Qcustomers->next()) {
if (!isset($audience[$Qcustomers->valueInt('customers_id')])) {
$audience[$Qcustomers->valueInt('customers_id')] = array('firstname' => $Qcustomers->value('customers_firstname'), 'lastname' => $Qcustomers->value('customers_lastname'), 'email_address' => $Qcustomers->value('customers_email_address'));
}
}
$Qcustomers = $osC_Database->query('select distinct pn.customers_id, c.customers_firstname, c.customers_lastname, c.customers_email_address from :table_products_notifications pn, :table_customers c left join :table_newsletters_log nl on (c.customers_email_address = nl.email_address and nl.newsletters_id = :newsletters_id) where pn.customers_id = c.customers_id and nl.email_address is null');
$Qcustomers->bindTable(':table_products_notifications', TABLE_PRODUCTS_NOTIFICATIONS);
$Qcustomers->bindTable(':table_customers', TABLE_CUSTOMERS);
$Qcustomers->bindTable(':table_newsletters_log', TABLE_NEWSLETTERS_LOG);
$Qcustomers->bindInt(':newsletters_id', $this->_newsletter_id);
if (isset($chosen) && !empty($chosen)) {
$Qcustomers->appendQuery('and pn.products_id in (:products_id)');
$Qcustomers->bindRaw(':products_id', implode(', ', $chosen));
}
$Qcustomers->execute();
while ($Qcustomers->next()) {
if (!isset($audience[$Qcustomers->valueInt('customers_id')])) {
$audience[$Qcustomers->valueInt('customers_id')] = array('firstname' => $Qcustomers->value('customers_firstname'), 'lastname' => $Qcustomers->value('customers_lastname'), 'email_address' => $Qcustomers->value('customers_email_address'));
}
}
if (sizeof($audience) > 0) {
$mimemessage = new email(array(base64_decode('WC1NYWlsZXI6IG9zQ29tbWVyY2UgKGh0dHA6Ly93d3cub3Njb21tZXJjZS5jb20p')));
$mimemessage->add_text($this->_newsletter_content);
$mimemessage->build_message();
foreach ($audience as $key => $value) {
$mimemessage->send($value['firstname'] . ' ' . $value['lastname'], $value['email_address'], '', EMAIL_FROM, $this->_newsletter_title);
$Qlog = $osC_Database->query('insert into :table_newsletters_log (newsletters_id, email_address, date_sent) values (:newsletters_id, :email_address, now())');
$Qlog->bindTable(':table_newsletters_log', TABLE_NEWSLETTERS_LOG);
$Qlog->bindInt(':newsletters_id', $this->_newsletter_id);
$Qlog->bindValue(':email_address', $value['email_address']);
$Qlog->execute();
$time_end = explode(' ', microtime());
$timer_total = number_format($time_end[1] + $time_end[0] - ($time_start[1] + $time_start[0]), 3);
if ($timer_total > $max_execution_time) {
echo '<p><font color="#38BB68"><b>' . TEXT_REFRESHING_PAGE . '</b></font></p>' . '<p><a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $_GET['page'] . '&nmID=' . $this->_newsletter_id . '&action=nmSendConfirm&' . (isset($global) && $global == 'true' ? 'global=true' : $chosen_get_string)) . '">' . TEXT_CONTINUE_MANUALLY . '</a></p>' . '<META HTTP-EQUIV="refresh" content="2; URL=' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $_GET['page'] . '&nmID=' . $this->_newsletter_id . '&action=nmSendConfirm&' . (isset($global) && $global == 'true' ? 'global=true' : $chosen_get_string)) . '">';
exit;
}
}
}
$Qupdate = $osC_Database->query('update :table_newsletters set date_sent = now(), status = 1 where newsletters_id = :newsletters_id');
$Qupdate->bindTable(':table_newsletters', TABLE_NEWSLETTERS);
$Qupdate->bindInt(':newsletters_id', $this->_newsletter_id);
$Qupdate->execute();
}
示例15: send
function send($newsletter_id)
{
global $HTTP_POST_VARS;
$audience = array();
if (isset($HTTP_POST_VARS['global']) && $HTTP_POST_VARS['global'] == 'true') {
$products_query = tep_db_query("select distinct pn.customers_id, c.customers_firstname, c.customers_lastname, c.customers_email_address from " . TABLE_CUSTOMERS . " c, " . TABLE_PRODUCTS_NOTIFICATIONS . " pn where c.customers_id = pn.customers_id");
while ($products = tep_db_fetch_array($products_query)) {
$audience[$products['customers_id']] = array('firstname' => $products['customers_firstname'], 'lastname' => $products['customers_lastname'], 'email_address' => $products['customers_email_address']);
}
$customers_query = tep_db_query("select c.customers_id, c.customers_firstname, c.customers_lastname, c.customers_email_address from " . TABLE_CUSTOMERS . " c, " . TABLE_CUSTOMERS_INFO . " ci where c.customers_id = ci.customers_info_id and ci.global_product_notifications = '1'");
while ($customers = tep_db_fetch_array($customers_query)) {
$audience[$customers['customers_id']] = array('firstname' => $customers['customers_firstname'], 'lastname' => $customers['customers_lastname'], 'email_address' => $customers['customers_email_address']);
}
} else {
$chosen = $HTTP_POST_VARS['chosen'];
$ids = implode(',', $chosen);
$products_query = tep_db_query("select distinct pn.customers_id, c.customers_firstname, c.customers_lastname, c.customers_email_address from " . TABLE_CUSTOMERS . " c, " . TABLE_PRODUCTS_NOTIFICATIONS . " pn where c.customers_id = pn.customers_id and pn.products_id in (" . $ids . ")");
while ($products = tep_db_fetch_array($products_query)) {
$audience[$products['customers_id']] = array('firstname' => $products['customers_firstname'], 'lastname' => $products['customers_lastname'], 'email_address' => $products['customers_email_address']);
}
$customers_query = tep_db_query("select c.customers_id, c.customers_firstname, c.customers_lastname, c.customers_email_address from " . TABLE_CUSTOMERS . " c, " . TABLE_CUSTOMERS_INFO . " ci where c.customers_id = ci.customers_info_id and ci.global_product_notifications = '1'");
while ($customers = tep_db_fetch_array($customers_query)) {
$audience[$customers['customers_id']] = array('firstname' => $customers['customers_firstname'], 'lastname' => $customers['customers_lastname'], 'email_address' => $customers['customers_email_address']);
}
}
$mimemessage = new email(array('X-Mailer: osCommerce'));
// Build the text version
$text = strip_tags($this->content);
if (EMAIL_USE_HTML == 'true') {
$mimemessage->add_html($this->content, $text);
} else {
$mimemessage->add_text($text);
}
$mimemessage->build_message();
reset($audience);
while (list($key, $value) = each($audience)) {
$mimemessage->send($value['firstname'] . ' ' . $value['lastname'], $value['email_address'], '', EMAIL_FROM, $this->title);
}
$newsletter_id = tep_db_prepare_input($newsletter_id);
tep_db_query("update " . TABLE_NEWSLETTERS . " set date_sent = now(), status = '1' where newsletters_id = '" . tep_db_input($newsletter_id) . "'");
}