Visualizzazione dei risultati da 1 a 3 su 3

Hybrid View

  1. #1
    ti spiego, con questo plugin ci sono 2 modalità per ricevere gli ordini, la prima è quella di riceverlo tramite una normale email, la seconda è sempre via mail ma in un phpmailer compreso nel plugin. il problema che ho riscontrato è nel primo caso che non si riesce a capire come modificare lo stile della mail che si riceve (vorrei mettere dei determinati dati in grassetto), la mail che viene ricevuta è scritta in modo molto "spoglio"...

    mentre nel secondo caso il phpmailer ha un template modificabile, ma non riesco a capire come installarlo. ce' un file dove bisogna mettere le impostazioni (server SMTP, host, mail, password ecc...) che ho messo, ma quando apro il file sul browser non mi appare assolutamente nulla, neanche messaggi d'errore ma solo una pagina completamente bianca...

    i file ineerenti alla mail si trovano nella cartella /templates del plugin è sono:

    - wppizza-order-email-html.php
    - wppizza-order-email-plaintext.php
    - wppizza-order-email-subject.php
    - wppizza-phpmailer-settings.php


    Quello dove è impostata la semplice email credo sia wppizza-order-email-plaintext.php di cui codice:
    Codice PHP:
    <?php
    /****************************************************************************************************************
    *
    *    WPPizza - Plaintext Email Template
    *
    *    Note: do not use html tags. it will not work . Know what you are doing.
    *
    *    if you are sending html emails with phpmailer (wppizza->settings->Select Type of Mail Delivery)
    *    you could also comment OUT
    *    $mail->AltBody = $this->orderMessage['plaintext'];
    *    in wppizza-phpmailer-settings.php as phpmailer will automatically generate plaintext emails form the html input
    *    if you do this, changes to this file will not make any difference
    *    make sure however, that you copy wppizza-phpmailer-settings.php to your theme directory
    *    as otherwise your changes will be overwritten in the next update of this plugin. just saying.....
    *
    ****************************************************************************************************************/
    ?>
    <?php
    /****************************************************************************
    *
    *    [header: date and time of order,gateway used,transactionid  etc]
    *
    ****************************************************************************/
    ?>
    ===========<?php echo $orderLabel['order_details'?>============
    <?php echo $nowdate ?>

    <?php echo $orderLabel['order_paid_by'?> <?php echo $gatewayUsed ?> (<?php echo $transactionId ?>)



    <?php
    /****************************************************************************
    *
    *    [customer details: whatever fields where enabled on order page]
    *
    ****************************************************************************/
    echo $emailPlaintext['customer_details'];
    ?>

    <?php
    /****************************************************************************
    *
    *    [order items: list of items ordered]
    *    to make thing reasonably pretty in plaintext emails , we pad with spaces
    *    as required as tabs do not seem to want to work
    *
    ****************************************************************************/
    $output='';
    foreach(
    $emailPlaintext['items'] as $k=>$v){

        
    $strPartLeft=''.$v['label'].'';/*made up of => '.$v['quantity'].'x '.$v['name'].' '.$v['size'].' ['.$v['currency'].' '.$v['price'].']'*/
        
    $spaces=75-strlen($strPartLeft);
        
    $strPartRight=''.$v['value'].'';/*made up of => '.$v['currency'].' '.$v['pricetotal'].'*/

        /**add to string, spacing left and right out somewhat and put linebreak before any additional info**/
        
    $output.=''.$strPartLeft.''.str_pad($strPartRight,$spaces," ",STR_PAD_LEFT).''.PHP_EOL.'';

        
    /**NOTE: DO NOT DELETE OR ALTER THE ADDITIONAL INFO DECLARATIONS OR YOU MIGHT BREAK THINGS. IF NOT NOW THAN POSSIBLY IN THE FUTURE AS OTHER EXTENSIONS MAY RELY ON THIS!!!*/
        
    if(isset($v['additional_info']) && $v['additional_info']!=''){$output.=''.$v['additional_info'].'';}

        
    /**add additional line break as spacer between items**/
        
    $output.=PHP_EOL;
    }
    /* print it */
    echo''.$output.'';
    /*****************************************************************************************************
        if you've changed the above and also want to store these changes in the order history->order details
        as opposed to just in plaintext emails uncomment the line below.
        YOU PROBABLY SHOULD DO A TEST ORDER AND CHECK HISTORY->ORDER DETAILS !!!
        IF IN DOUBT, LEAVE IT COMMENTED OUT
    *****************************************************************************************************/
    /* $emailPlaintext['db_items']=$output; */
    ?>


    <?php
    /************************************************************************************************
    *
    *    [order summary: price/tax/discount/delivery options etc]
    *
    ************************************************************************************************/
    echo $emailPlaintext['order_summary'];
    ?>

    <?php
    /****************************************************************************
    *
    *    [footer]
    *
    ****************************************************************************/
    ?>
    ====================================================================

    <?php
        
    echo $orderLabel['order_email_footer'];
    ?>


    Quello dove vanno settati i parametri mail per il phpmailer è wppizza-phpmailer-settings.php :
    Codice PHP:
    <?php
    /*************************************************************************************************
    *
    *    WPPizza PHPMailer Settings
    *    [settings to send emails with phpmailer]
    *    [if you wish to edit these, copy this file to your template directory 
    *    and edit it there so it does not get overwritten in future upgrades]
    *
    *
    **************************************************************************************************/
    //$mail->IsSMTP(); // uncomment if you want the class to use SMTP and set accordingly below
    try {
        
    $mail->CharSet $this->blogCharset
        
    /*if you want to use smtp set as required below**/
        /*settings here are for using gmail . adjust as needed **/    
          //$mail->Host       = "yourdomain.com"; // SMTP server
          //$mail->SMTPDebug  = 2;                     // enables SMTP debug information (for testing)
          //$mail->SMTPAuth   = true;                  // enable SMTP authentication
          //$mail->SMTPSecure = "ssl";                 // sets the prefix to the servier
          //$mail->Host       = "smtp.gmail.com";      // sets GMAIL as the SMTP server
          //$mail->Port       = 465;                   // set the SMTP port for the GMAIL server
          //$mail->Username   = "yourmail@gmail.com";  // GMAIL username
          //$mail->Password   = "password";            // GMAIL password
          
          /**if you want, you can also try setting the following***/ 
        //$mail->Priority = 1;//Priority : For most clients expecting the Priority header: 1 = High, 2 = Medium, 3 = Low
        //$mail->AddCustomHeader("X-MSMail-Priority: High"); //MS Outlook custom header May set to "Urgent" or "Highest" rather than "High"
        //$mail->AddCustomHeader("X-MimeOLE" , "Produced By Microsoft MimeOLE V6.00.2800.1441"); 
        //$mail->AddCustomHeader("X-Mailer" , "Microsoft Office Outlook, Build 11.0.5510"); // Faking Outlook Header         
          
          

        /**who to send the order to**/
        
    foreach($this->pluginOptions['order']['order_email_to'] as $k=>$v){
            
    $mail->AddAddress(''.$v.'''');
        }
        
    /**any bcc's set in options ?**/
        
    if(count($this->pluginOptions['order']['order_email_bcc'])>0){
            foreach(
    $this->pluginOptions['order']['order_email_bcc'] as $bcc){
                
    $mail->AddBCC("".$bcc."");
            }
        }
        
        
    /**who the order is from. (if given). might be statically set**/
        
    if($orderFromEmail!=''){
            
    $fromName=trim($orderFromName); 
            if(
    $fromName==''){$fromName='----';}
            
    $replyToCCName=trim($this->orderClientName); 
            if(
    $replyToCCName==''){$replyToCCName='----';}    //if we want, we could set $fromName=get_bloginfo() for example if no name was given...        
            
            
            
    $mail->SetFrom(''.$orderFromEmail.'',''.$fromName.'');/*by default, these are the customer submitted name/email. However these might also be statically set in order settings*/
            
    $mail->AddReplyTo(''.$this->orderClientEmail.''''.$replyToCCName.'');
            
    $mail->AddCC(''.$this->orderClientEmail.'',''.$replyToCCName.'');
        }
        
    /**the subject**/
        
    $mail->Subject '' $this->subjectPrefix $this->subject .  $this->subjectSuffix '';
        
        
    /**the html**/
        
    $mail->MsgHTML($orderHtml);
        
    $mail->AltBody $this->orderMessage['plaintext']; // optional - MsgHTML will create an alternate automatically, however this has been prettied up a little for this plugin. If you must, feel free to comment this line out though


        /*****in case you want to use an attachment*****************
        *
        *    [uncomment and edit lines below to point to your image or any ather attachment you migh want to add to email]
        *
        *******************************************************/
        //$mailAttachment='/absolute/path/to/your/image.jpg';
        //if(isset($mailAttachment) && $mailAttachment!=''){
        //    $mail->AddAttachment($mailAttachment);
        //}



        /**send the mail**/
        
    $mail->Send();
        
        
    $sendMail['status']=true;
    } catch (
    phpmailerException $e) {
        
    $mailError=$e->errorMessage();//Pretty error messages from PHPMailer
        
    $sendMail['status']=false;
        
    $sendMail['error']=$mailError;
    } catch (
    Exception $e) {
        
    $mailError=$e->getMessage();//Boring error messages from anything else!
        
    $sendMail['status']=false;
        
    $sendMail['error']=$mailError;
    }
    /**set to phpmailer to be able to identify function if errors are thrown**/
    $sendMail['mailer']='phpmailer';
    ?>


    che file e che stringe dovrei andar a modificare?
    Ultima modifica di crisbr89; 13-12-2013 a 18:26

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.