Hi, i've found a solution in the german forum. I use it a little bit modified.
includes/languages/XXX/checkout process.php
add
//BOC e-mail with attachment
function tep_mail_pdf_anhang($to_name, $to_email_address, $email_subject, $email_text, $from_email_name, $from_email_address, $file, $filetype) {
if (SEND_EMAILS != 'true') return false;
if (eregi('Content-Type:', $to_name)) return false;
if (eregi('Content-Type:', $to_email_address)) return false;
if (eregi('Content-Type:', $email_subject)) return false;
if (eregi('Content-Type:', $email_text)) return false;
if (eregi('Content-Type:', $from_email_name)) return false;
if (eregi('Content-Type:', $from_email_address)) return false;
if ( (strstr($to_name, "\n") != false) || (strstr($to_name, "\r") != false) ) return false;
if ( (strstr($to_email_address, "\n") != false) || (strstr($to_email_address, "\r") != false) ) return false;
if ( (strstr($email_subject, "\n") != false) || (strstr($email_subject, "\r") != false) ) return false;
if ( (strstr($from_email_name, "\n") != false) || (strstr($from_email_name, "\r") != false) ) return false;
if ( (strstr($from_email_address, "\n") != false) || (strstr($from_email_address, "\r") != false) ) return false;
$message = new email(array('X-Mailer: osCommerce Mailer'));
$text = strip_tags($email_text);
if (EMAIL_USE_HTML == 'true') {
$message->add_html($email_text, $text);
} else {
$message->add_text($text);
}
$attachment = fread(fopen($file, "r"), filesize($file));
$message->add_attachment($attachment, TEXT_NAME_OF_CONDITIONS, $filetype);
// $message->add_html_image($file_content, $file);
$message->build_message();
$message->send($to_name, $to_email_address, $from_email_name, $from_email_address, $email_subject);
}
//EOC e-mail with attachment
checkout_process.php
find
tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
replace with
tep_mail_pdf_anhang($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, DIR_WS_LANGUAGES . $language . "/" . "conditions.pdf", "application/pdf");
Drop a PDF named "conditions.pdf" to your language folder.
Please comment!
Black Jack 21