X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (X-Cart 5) (https://forum.x-cart.com/forumdisplay.php?f=56)
-   -   Customize Email & Invoce (https://forum.x-cart.com/showthread.php?t=69186)

Mak 05-15-2014 08:09 AM

Customize Email & Invoce
 
Can someone share some insight on how to customize the email that is sent to the customer and how to modify the font and layout of the invoice...

Thanks in advance

tony_sologubov 05-16-2014 05:52 AM

Re: Customize Email & Invoce
 
Quote:

Originally Posted by Mak
Can someone share some insight on how to customize the email that is sent to the customer and how to modify the font and layout of the invoice...

Thanks in advance


You can use Custom Skins module in order to alter X-Cart 5 emails. Could you please let me know what exactly you want to change, so I would be able to suggest the exact steps.

Mak 05-16-2014 07:13 AM

Re: Customize Email & Invoce
 
Thanks for the reply...

I have the custom skins module installed but don't see any way to edit emails.
Maybe I dont know how to use it.. Is there documentation?

Currently the emails come over with errors, here is an example:
Notice the html and = all over the place....

The font is also, all over the place..

Invoice #5
May 15, 2014, 12:17 Grand = total: $0.00
= <= /tr>
Item Price Qty Total
demo free=
Key: demofre= e1
SKU demo free
$0.00 1 $0.00
Subtotal:
$0.00
Grand total:
$0.00
=

tony_sologubov 05-20-2014 03:35 AM

Re: Customize Email & Invoce
 
One of our previous webinars is a documentation of Custom Skin module. It explains how you can use it: http://kb.x-cart.com/pages/viewpage.action?pageId=7504837

As for the errors you mentioned, could you please let me know what language you are using in your store? Besides that, could you please send me the copy of your invoice email to support@x-cart.com?

Thank you.

Mak 05-21-2014 01:39 PM

Re: Customize Email & Invoce
 
English

Email Sent..

tony_sologubov 05-22-2014 04:55 AM

Re: Customize Email & Invoce
 
Thank you. Apparently, there is a problem with the server environment. I will reply to you via email.

Tony.

JannieB 03-30-2015 08:22 AM

Re: Customize Email & Invoce
 
Hi,
Did you every get to the bottom of this problem? I am having a similar issue ... email comes out with html code as text and messed up layout and fonts. I am using x-cat 5.1.11 and it is running on PHP 5.3 at the moment ....
... is it an issue to with phpmailer?

Thanks in advance ...

Jan

tony_sologubov 04-03-2015 03:21 AM

Re: Customize Email & Invoce
 
Hello @JannieB,

We did not get to the root of the problem. However, could you please forward me a problem notification at sales@x-cart.com saying that this is for Tony Sologubov.

I would like to have a look at how exactly your notification is messed up.

Tony

JannieB 04-03-2015 04:52 AM

Re: Customize Email & Invoce
 
Hi Tony,

Thank you - I think I have fixed the problem now .....

When looking at the html output I noticed the lines were broken up, sometimes in the middle of an html tag which seemed to cause formatting problems. Also some rogue characters were introduced.

Rogue unprintable characters can be intoduced by UTF-8 files which have the UTF-8 BOM at the beginning. I don't know if they had, but I went through each template in Dreamweaver and re-saved them with UTF-8 and no BOM.

The line breaks were a result of the encoding (I think), looking in Xlite/View/Mailer.php the encoding was set to "quoted-printable" in the initMailFromConfig() function. The default used by PHP Mailer is 8-bit, so I just commented out this line

Code:

$this->mail->Encoding = 'quoted-printable';

in the var/run version of the Mailer.php file, so that it would use the default setting and to see if it made any difference. The email then came through correctly formatted.

So I have know add a decorated version of Mailer.php to my module as follows:

Code:

class Mailer extends \XLite\View\Mailer implements \XLite\Base\IDecorator
{
   

    /**
    * Inner mailer initialization from DB configuration
    *
    * @return void
    */
    protected function initMailFromConfig()
    {
        if (!isset($this->mail)) {

            // Initialize PHPMailer
            include_once LC_DIR_LIB . 'PHPMailer' . LC_DS . 'class.phpmailer.php';

            $this->mail = new \PHPMailer();
            // SMTP settings
            if (\XLite\Core\Config::getInstance()->Email->use_smtp) {
                $this->mail->Mailer = 'smtp';
                $this->mail->Host = \XLite\Core\Config::getInstance()->Email->smtp_server_url;
                $this->mail->Port = \XLite\Core\Config::getInstance()->Email->smtp_server_port;

                if (\XLite\Core\Config::getInstance()->Email->use_smtp_auth) {
                    $this->mail->SMTPAuth = true;
                    $this->mail->Username = \XLite\Core\Config::getInstance()->Email->smtp_username;
                    $this->mail->Password = \XLite\Core\Config::getInstance()->Email->smtp_password;
                }
                if (in_array(\XLite\Core\Config::getInstance()->Email->smtp_security, array('ssl', 'tls'))) {
                    $this->mail->SMTPSecure = \XLite\Core\Config::getInstance()->Email->smtp_security;
                }
            }

            $this->mail->SMTPDebug = true;
            $this->mail->IsHTML(true);
     
        }
    }

 
}


The weird thing is, that I am sure this wasn't happening before ... anyway it seems to be OK now, so now I just need to restyle all the emails to meet the designers brief ... oh joy!

Thanks,

Jan

tony_sologubov 04-06-2015 11:58 AM

Re: Customize Email & Invoce
 
It would be interesting to see headers of your email, because I just googled the problem and people say that it might be related to Content-Type header being replaced with Content-type one (with type starts with small letter):
http://forums.sugarcrm.com/f3/email-encoded-quoted-printable-dont-display-correctly-49862/


All times are GMT -8. The time now is 12:19 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.