Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [HTML][PHP]Zamówienia email
mrk9109
post
Post #1





Grupa: Zarejestrowani
Postów: 445
Pomógł: 3
Dołączył: 4.06.2010

Ostrzeżenie: (0%)
-----


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
Go to the top of the page
+Quote Post
nospor
post
Post #2





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




Zrobic tresc html ladna jaka chccesz a w mailu powiedziec ze to html?


--------------------

"Myśl, myśl, myśl..." - Kubuś Puchatek || "Manual, manual, manual..." - Kubuś Programista
"Szukaj, szukaj, szukaj..." - Kubuś Odkrywca || "Debuguj, debuguj, debuguj..." - Kubuś Developer

Go to the top of the page
+Quote Post
mrk9109
post
Post #3





Grupa: Zarejestrowani
Postów: 445
Pomógł: 3
Dołączył: 4.06.2010

Ostrzeżenie: (0%)
-----


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
Go to the top of the page
+Quote Post
nospor
post
Post #4





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




No to pokaz jak przerabiasz i napisz jaki masz blad. No skad mamy wiedziec co robisz zle


--------------------

"Myśl, myśl, myśl..." - Kubuś Puchatek || "Manual, manual, manual..." - Kubuś Programista
"Szukaj, szukaj, szukaj..." - Kubuś Odkrywca || "Debuguj, debuguj, debuguj..." - Kubuś Developer

Go to the top of the page
+Quote Post
mrk9109
post
Post #5





Grupa: Zarejestrowani
Postów: 445
Pomógł: 3
Dołączył: 4.06.2010

Ostrzeżenie: (0%)
-----


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. }


Ten post edytował mrk9109 12.12.2017, 12:22:17
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 21.08.2025 - 09:54