Antwort #2 am: 22. August 2013, 11:54:06
Hallo web28,
ich verwende die neueste Version von modified.
Ich habe das versucht mit deinem Tip allerdings ist es egal wie die variable in send_order.php heisst, da dort ja der mail versand deklariert wird. Man muss dort halt die richtige variablen einfügen.
Habe das jetzt mal so geändert.
foreach($gutschein_statuses as $val) { define('FPDF_FONTPATH',DIR_FS_CATALOG
.'includes/fpdf/font/'); if ($val['anzahl'] > 1 ){ for ($i = 1; $i <= $val['anzahl']; $i++) { $pdf = new HTML2PDF
(); $pdf->AddFont('ptsans','','ptsans.php'); $pdf->AddPage ( 'P' ); $pdf->Image(DIR_FS_CATALOG
.'images/product_images/original_images/'.$val['id'].'_'.$img.'.jpg',0,0,210,297 ); $pdf->SetFont('ptsans','',10); $pdf->SetTextColor(112, 111, 111); $pdf->SetXY(120,160); $pdf->SetLeftMargin(67); $html=stripslashes($val['text']); $pdf->Multicell(10,10, $pdf->WriteHTML($html)); $pdf->SetFontSize(8); $pdf->SetTextColor(135, 135, 135); $pdf->Multicell(10,5,$pdf->WriteHTML($text.$insert_id.'-'.$i)); $pdf->Multicell(10,5,$pdf->WriteHTML($text1)); $pdf->Multicell(10,5,$pdf->WriteHTML($text2)); $pdf->Output(DIR_FS_CATALOG
.'giftvoucher/pdf/Gutschein-'.$insert_id.'-'.$val['id'].'-'.$i.'.pdf', 'F'); $path_to_more_attachments[]= DIR_FS_CATALOG
.'giftvoucher/pdf/Gutschein-'.$insert_id.'-'.$val['id'].'-'.$i.'.pdf'; } }else{ $pdf = new HTML2PDF
(); $pdf->AddFont('ptsans','','ptsans.php'); $pdf->AddPage ( 'P' ); $pdf->Image(DIR_FS_CATALOG
.'images/product_images/original_images/'.$val['id'].'_'.$img.'.jpg',0,0,210,297 ); $pdf->SetFont('ptsans','',10); $pdf->SetTextColor(112, 111, 111); $pdf->SetXY(120,160); $pdf->SetLeftMargin(67); $html=stripslashes($val['text']); $pdf->Multicell(10,10, $pdf->WriteHTML($html)); $pdf->SetFontSize(8); $pdf->SetTextColor(135, 135, 135); $pdf->Multicell(10,5,$pdf->WriteHTML($text.$insert_id)); $pdf->Multicell(10,5,$pdf->WriteHTML($text1)); $pdf->Multicell(10,5,$pdf->WriteHTML($text2)); $pdf->Output(DIR_FS_CATALOG
.'giftvoucher/pdf/Gutschein-'.$insert_id.'-'.$val['id'].'.pdf', 'F'); $path_to_more_attachments[]= DIR_FS_CATALOG
.'giftvoucher/pdf/Gutschein-'.$insert_id.'-'.$val['id'].'.pdf'; } } $co_code = xtc_db_query
("SELECT coupon_code FROM ".TABLE_ORDERS
." WHERE orders_id = '".$insert_id."'"); $co_co = xtc_db_fetch_array
($co_code); //if(file_exists(DIR_FS_DOCUMENT_ROOT.'giftvoucher/pdf/'.$co_co['coupon_code'].'.pdf')){ $path_to_more_attachments[]= DIR_FS_CATALOG
.'giftvoucher/pdf/'.$co_co['coupon_code'].'.pdf'; // } Allerdings wir die PDF datei ausserhalb der foreach schleife nicht angehängt. (Sie ist aber auf dem server vorhanden!)
Der send auschnitt sieht so aus
// send mail to admin
xtc_php_mail(EMAIL_BILLING_ADDRESS,
EMAIL_BILLING_NAME,
EMAIL_BILLING_ADDRESS,
STORE_NAME,
EMAIL_BILLING_FORWARDING_STRING,
$order->customer['email_address'],
$order->customer['firstname'].' '.$order->customer['lastname'],
$path_to_attachments,
$path_to_more_attachments,
$order_subject,
$html_mail,
$txt_mail
);
// send mail to customer
if (SEND_EMAILS == 'true' || $send_by_admin) {
xtc_php_mail(EMAIL_BILLING_ADDRESS,
EMAIL_BILLING_NAME,
$order->customer['email_address'],
$order->customer['firstname'].' '.$order->customer['lastname'],
'',
EMAIL_BILLING_REPLY_ADDRESS,
EMAIL_BILLING_REPLY_ADDRESS_NAME,
$path_to_attachments,
$path_to_more_attachments,
$order_subject,
$html_mail,
$txt_mail
);
}