function sendEmail() { if (count($this->info) > 0) { $to_name = ''; $to_address = $this->email_address; $subject = IPN_PAYMENT_MODULE_NAME; $this->add(IPN_EMAIL, IPN_EMAIL_MSG); $msg = strip_tags(nl2br($this->info())); $from_name = IPN_PAYMENT_MODULE_NAME; $from_address = strtolower(trim($this->email_address)); olc_mail($to_name, $to_address, $subject, $msg, $from_name, $from_address); } }
$messageStack->add_session(SUCCESS_BILLING, 'success'); olc_redirect(olc_href_link(FILENAME_AFFILIATE_PAYMENT, olc_get_all_get_params(array('action')) . 'action=edit')); break; case 'update_payment': $pID = olc_db_prepare_input($_GET['pID']); $status = olc_db_prepare_input($_POST['status']); $payment_updated = false; $check_status_query = olc_db_query("select af.affiliate_email_address, ap.affiliate_lastname, ap.affiliate_firstname, ap.affiliate_payment_status, ap.affiliate_payment_date, ap.affiliate_payment_date from " . TABLE_AFFILIATE_PAYMENT . " ap, " . TABLE_AFFILIATE . " af where affiliate_payment_id = '" . olc_db_input($pID) . "' and af.affiliate_id = ap.affiliate_id "); $check_status = olc_db_fetch_array($check_status_query); if ($check_status['affiliate_payment_status'] != $status) { olc_db_query(SQL_UPDATE . TABLE_AFFILIATE_PAYMENT . " set affiliate_payment_status = '" . olc_db_input($status) . "', affiliate_last_modified = now() where affiliate_payment_id = '" . olc_db_input($pID) . APOS); $affiliate_notified = '0'; // Notify Affiliate if ($_POST['notify'] == 'on') { $email = STORE_NAME . NEW_LINE . EMAIL_SEPARATOR . NEW_LINE . EMAIL_TEXT_AFFILIATE_PAYMENT_NUMBER . BLANK . $pID . NEW_LINE . EMAIL_TEXT_INVOICE_URL . BLANK . olc_catalog_href_link(FILENAME_CATALOG_AFFILIATE_PAYMENT_INFO, 'payment_id=' . $pID, SSL) . NEW_LINE . EMAIL_TEXT_PAYMENT_BILLED . BLANK . olc_date_long($check_status['affiliate_payment_date']) . "\n\n" . sprintf(EMAIL_TEXT_STATUS_UPDATE, $payments_status_array[$status]); olc_mail($check_status['affiliate_firstname'] . BLANK . $check_status['affiliate_lastname'], $check_status['affiliate_email_address'], EMAIL_TEXT_SUBJECT, nl2br($email), STORE_OWNER, AFFILIATE_EMAIL_ADDRESS); $affiliate_notified = '1'; } olc_db_query(INSERT_INTO . TABLE_AFFILIATE_PAYMENT_STATUS_HISTORY . " (affiliate_payment_id, affiliate_new_value, affiliate_old_value, affiliate_date_added, affiliate_notified) values ('" . olc_db_input($pID) . "', '" . olc_db_input($status) . "', '" . $check_status['affiliate_payment_status'] . "', now(), '" . $affiliate_notified . "')"); $order_updated = true; } if ($order_updated) { $messageStack->add_session(SUCCESS_PAYMENT_UPDATED, 'success'); } olc_redirect(olc_href_link(FILENAME_AFFILIATE_PAYMENT, olc_get_all_get_params(array('action')) . 'action=edit')); break; case 'deleteconfirm': $pID = olc_db_prepare_input($_GET['pID']); olc_db_query(DELETE_FROM . TABLE_AFFILIATE_PAYMENT . " where affiliate_payment_id = '" . olc_db_input($pID) . APOS); olc_db_query(DELETE_FROM . TABLE_AFFILIATE_PAYMENT_STATUS_HISTORY . " where affiliate_payment_id = '" . olc_db_input($pID) . APOS); olc_redirect(olc_href_link(FILENAME_AFFILIATE_PAYMENT, olc_get_all_get_params(array('pID', 'action'))));
function notifyCustomer(&$order) { $customer_notification = SEND_EMAILS == TRUE_STRING_S ? '1' : '0'; olc_db_query(INSERT_INTO . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified) values ('" . (int) $this->orderID . "', '" . MODULE_PAYMENT_PAYPAL_ORDER_STATUS_ID . "', now(), '" . $customer_notification . "')"); // lets start with the email confirmation include $this->checkoutProcessLanguageFile; $email_order = STORE_NAME . NEW_LINE . EMAIL_SEPARATOR . NEW_LINE . EMAIL_TEXT_ORDER_NUMBER . ' ' . $this->orderID . NEW_LINE . EMAIL_TEXT_INVOICE_URL . ' ' . $this->accountHistoryInfoURL . NEW_LINE . EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n"; $customerComments = $this->getCustomerComments(); if ($customerComments) { $email_order .= olc_db_output($customerComments) . "\n\n"; } $email_order .= EMAIL_TEXT_PRODUCTS . NEW_LINE . EMAIL_SEPARATOR . NEW_LINE . $this->products_ordered . EMAIL_SEPARATOR . NEW_LINE; for ($i = 0, $n = sizeof($order->totals); $i < $n; $i++) { $email_order .= strip_tags($order->totals[$i]['title']) . ' ' . strip_tags($order->totals[$i]['text']) . NEW_LINE; } if ($this->contentType != 'virtual') { $email_order .= NEW_LINE . EMAIL_TEXT_DELIVERY_ADDRESS . NEW_LINE . EMAIL_SEPARATOR . NEW_LINE . olc_address_label($order->customer['id'], $this->sendTo, 0, '', NEW_LINE) . NEW_LINE; } $email_order .= NEW_LINE . EMAIL_TEXT_BILLING_ADDRESS . NEW_LINE . EMAIL_SEPARATOR . NEW_LINE . olc_address_label($order->customer['id'], $this->billTo, 0, '', NEW_LINE) . "\n\n"; $email_order .= EMAIL_TEXT_PAYMENT_METHOD . NEW_LINE . EMAIL_SEPARATOR . NEW_LINE; $email_order .= $this->paymentTitle . "\n\n"; olc_mail($order->customer['name'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); // send emails to other people if (SEND_EXTRA_ORDER_EMAILS_TO != '') { olc_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); } }