Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [HTML][PHP]Zamówienia email
Forum PHP.pl > Forum > Przedszkole
mrk9109
Witam mam taką funkcję która odpowiada w moim sklepie za wysyłanie maili

  1. public function sendEmailWithOrderDetails( $iOrder ){
  2. global $lang, $config;
  3.  
  4. $aData = $this->throwOrder( $iOrder );
  5. $aUrls = throwSiteUrls( );
  6. $sOrderUrlEmail = $aUrls['sHomeUrl'].$GLOBALS['oPage']->aPages[$config['order_print']]['sLinkName'].'&sKey='.$this->throwOrderKey( $aData );
  7. $sMailContent = str_replace( '|n|', "\n", $lang['Order_customer_email_head']."\n------------------------\n".$lang['Order_customer_personal']."\n------------------------\n".$aData['sFirstName'].' '.$aData['sLastName'].( isset( $aData['sCompanyName'] ) ? "\n".$aData['sCompanyName'] : null )."\n".$aData['sStreet']."\n".$aData['sZipCode'].' '.$aData['sCity']."\n".$aData['sPhone']."\n".$aData['sEmail'].( isset( $aData['sComment'] ) ? "\n\n".$lang['Comment'].': '.$aData['sComment'] : null )."\n------------------------\n".$lang['Order_customer_products']."\n------------------------".$this->listProducts( $iOrder, true )."\n------------------------\n".( isset( $aData['iShipping'] ) ? $lang['Order_customer_shipping']."\n------------------------\n".$aData['mShipping'].' ('.$aData['mPayment'].') = '.$this->aOrders[$iOrder]['sPaymentShippingPrice'].' '.$config['currency_symbol']."\n\n" : null ).$lang['Summary_cost'].': '.$this->aOrders[$iOrder]['sOrderSummary'].' '.$config['currency_symbol']."\n------------------------\n".$lang['Check_order_status_url']."\n".$sOrderUrlEmail."\n-------------------\n".$lang['Order_customer_email_foot'] );
  8.  
  9. // the following phrase must be present in the email's content. See the license - <a href="http://opensolution.org/licenses.html" target="_blank">http://opensolution.org/licenses.html</a>
  10. $sMailContent .= "\n\n".( LANGUAGE == 'pl' ) ? 'Wysłane przez program Quick.Cart' : 'Sent by the Quick.Cart program';
  11.  
  12. if( $config['send_customer_order_details'] === true ){
  13. @mail( $aData['sEmail'], '=?UTF-8?B?'.base64_encode( $lang['Order_customer_info_title'].$iOrder ).'?=', $sMailContent, 'MIME-Version: 1.0'."\r\n".'Content-type: text/plain; charset=UTF-8'."\r\n".( ( $config['emails_from_header_option'] == 2 ) ? 'Reply-to: '.$config['orders_email'] : 'From: '.$config['orders_email'] ) );
  14. }
  15.  
  16. @mail( $config['orders_email'], '=?UTF-8?B?'.base64_encode( $lang['Order_customer_info_title'].$iOrder ).'?=', $sMailContent, 'MIME-Version: 1.0'."\r\n".'Content-type: text/plain; charset=UTF-8'."\r\n".( ( $config['order_details_from_customer'] === true && $config['emails_from_header_option'] == 1 ) ? 'From: '.$aData['sEmail'] : ( ( $config['emails_from_header_option'] == 1 ) ? 'From: '.$config['orders_email'] : 'Reply-to: '.$aData['sEmail'] ) ) );
  17. }

Moje pytanie brzmi jak przerobić Mailcontent aby zrobić to ładnie estetycznie w htmlu
nospor
Zrobic tresc html ladna jaka chccesz a w mailu powiedziec ze to html?
mrk9109
chce wyglad jakiś zrobić tzn obrazek wkleic by to jakoś wyglądało myślałem by zastosować do tej zmiennej eval i import pliku html z wygladem ale nie wiem czy to by wypaliło

http://php.net/manual/en/function.mail.php

tu mam przyklad w htmlu na tabelki ale nie wiem jak przerobic ten kod probowal i ciagle blad
nospor
No to pokaz jak przerabiasz i napisz jaki masz blad. No skad mamy wiedziec co robisz zle
mrk9109
A więc tak zmienią sMailContent zamieniłem na coś takie ( kombinowałem )

  1. while ($sMailContent) {
  2.  
  3. $head=$lang['Order_customer_email_head'];
  4. $personal=$lang['Order_customer_personal'];
  5. $first=$aData['sFirstName'];
  6. $last=$aData['sLastName'];
  7. $company=$aData['sCompanyName'];
  8. $street=$aData['sStreet'];
  9. $zipcode=$aData['sZipCode'];
  10. $scity=$aData['sCity'];
  11. $phone=$aData['sPhone'];
  12. $email=$aData['sEmail'];
  13. $scoment=$aData['sComment'];
  14. $comment=$lang['Comment'];
  15. $products=$lang['Order_customer_products'];
  16. $shipping= $aData['iShipping'];
  17. $oshipping=$lang['Order_customer_shipping'];
  18. $mshipping=$aData['mShipping'];
  19. $payment=$aData['mPayment'];
  20. $cost=$lang['Summary_cost'];
  21. $order=$lang['Check_order_status_url'];
  22. $orderue=$sOrderUrlEmail;
  23. $foot=$lang['Order_customer_email_foot'];
  24.  
  25.  
  26. eval ("\$mail = \"".gettemplate("mail")."\";");
  27. echo $mail;
  28. }
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.