I'm trying to use the pdfinvoice email attatchment together with Paypal Express Checkout, but I can't get it to work.
Have tried to insert the following in the Paypal Express file ppeb.php:
// BEGIN added for pdfinvoice email attachment:
// Next line removed in original file
// tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
if (PDF_INVOICE_EMAIL_ATTACHMENT == 'true') {
// customers will be logged in so usual security checks of pdfinvoice.php will be met. All we do is set the order_id for pdfinvoice.php to pick up
$HTTP_GET_VARS['order_id'] = $insert_id;
// set stream mode
$stream = true;
// include pdfinvoice.php
include_once(FILENAME_CUSTOMER_PDF);
// add text to email informing customer a pdf invoice copy has been attached:
$email_order .= PDF_INVOICE_ATTACHED ."\n\n";
// send email with pdf invoice attached. Check to make sure pdfinvoice.php returns some data, else send standard email
// note $order object reinstantiated by inclusion of pdfinvoice.php hence customer['name']
if (tep_not_null($pdf_data)) {
tep_mail_string_attachment($order->customer['name'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, $pdf_data, $file_name);
} else {
tep_mail($order->customer['name'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
}
} else {
// send vanilla e-mail - if email attachment option is false
tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
}
// END added for pdfinvoice email attachment:
/// --- end ---- checkout process email function
Hope somebody have an Idea