Neuigkeiten
  • Die modified eCommerce Shopsoftware ist kostenlos, aber nicht umsonst.
    Spenden
  • Damit wir die modified eCommerce Shopsoftware auch zukünftig kostenlos anbieten können:
    Spenden
  • Thema: Mail Versand in send_order.php

    mic187

    • Neu im Forum
    • Beiträge: 16
    Mail Versand in send_order.php
    am: 16. August 2013, 09:26:26
    Hallo ich habe ein technisches problem und komme nicht auf den fehler.

    Code: PHP  [Auswählen]

    $email_attachments_more[]= 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/'.$codenummer.'.pdf')){
            $email_attachments_more[]= DIR_FS_CATALOG.'giftvoucher/pdf/'.$co_co['coupon_code'].'.pdf';
            //      }      

    So das obere email_attachements wird mitgesendet, und das 2 nicht obwohl die variable gefüllt und die datei auch auf dem Server vorhanden ist.

    Kann mir da jemand helfen ?

    Gruß Michael

    Linkback: https://www.modified-shop.org/forum/index.php?topic=27322.0

    web28

    • modified Team
    • Beiträge: 9.404
    Re: Mail Versand in send_order.php
    Antwort #1 am: 16. August 2013, 12:17:32
    Attachments werden erst ab modified 1.06 unterstützt. Auch Attachment Arrays. Die Parameter heißen aber $path_to_attachments, $path_to_more_attachments

    Schau Dir mal die aktuelle inc/xtc_php_mail.inc.php an

    mic187

    • Neu im Forum
    • Beiträge: 16
    Re: Mail Versand in send_order.php
    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.

    Code: PHP  [Auswählen]
    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
    Code: PHP  [Auswählen]
    // 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
                   );
      }
     
    5 Antworten
    2708 Aufrufe
    04. Juni 2017, 00:50:05 von Ingo-D
    8 Antworten
    4061 Aufrufe
    17. Juli 2015, 08:24:14 von fishnet
    5 Antworten
    2935 Aufrufe
    19. November 2015, 18:56:53 von WayneTsun
    33 Antworten
    12363 Aufrufe
    26. April 2013, 22:03:20 von phpGuru