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/

JannieB 04-07-2015 12:29 AM

Re: Customize Email & Invoce
 
Hi Tony,

It doesn't seem to be that. Here are the headers from one of the mangled messages.

Code:

Return-path: <jan@8dd.co.uk>
Envelope-to: jan@8dd.co.uk
Delivery-date: Tue, 31 Mar 2015 16:26:04 +0100
Received: from ns1.cipherwebhost.com ([217.199.165.123]:41331 helo=cipherwebhost.com)
        by r8-london.webserversystems.com with esmtps (TLSv1:DHE-RSA-AES256-SHA:256)
        (Exim 4.82)
        (envelope-from <jan@8dd.co.uk>)
        id 1Ycy3G-0004tQ-Ry
        for jan@8dd.co.uk; Tue, 31 Mar 2015 16:26:04 +0100
Received: by cipherwebhost.com (Postfix, from userid 10065)
        id 3B4933C00737; Tue, 31 Mar 2015 16:21:13 +0100 (BST)
To: jan@8dd.co.uk
Subject: Moleta Munro: Order receipt #30!
X-PHP-Originating-Script: 10065:class.phpmailer.php
Date: Tue, 31 Mar 2015 16:21:13 +0100
From: "jan@8dd.co.uk" <jan@8dd.co.uk>
Message-ID: <0025b7c0b0d197e751cc0751a9f49a3b@moletamunro.com.217-199-165-124.cipherwebhost.com>
X-Priority: 3
X-Mailer: PHPMailer 5.2.7 (https://github.com/PHPMailer/PHPMailer/)
MIME-Version: 1.0
Content-Type: multipart/alternative;
        boundary="b1_0025b7c0b0d197e751cc0751a9f49a3b"
Content-Transfer-Encoding: quoted-printable



Jan

Burpomatic 04-07-2015 05:20 AM

Re: Customize Email & Invoce
 
Hello,

I am having the same problems. However, unlike JannieB, my header does contain the "content-type" with no capital "T".

Code:

Content-type: text/plain; charset=UTF-8
Content-transfer-encoding: 8BIT


What would be the way to fix this?

Thank you,

tony_sologubov 04-08-2015 11:39 AM

Re: Customize Email & Invoce
 
@JannieB, what email client are you using? Maybe is this software related?
I remember that you saw this problem before, but I do not remember how I fixed that and whether there was a commit to the core.

@Burpomatic
The solution is generously described by JannieB here:
http://forum.x-cart.com/showpost.php?p=384855&postcount=9

Please, let us know if the solution makes sense to you.

Burpomatic 04-08-2015 01:05 PM

Re: Customize Email & Invoce
 
Hello Tony,

Yes JannieB's solution works, but I thought there could have been a more "direct" solution to correcting the "content-type" instead.

Thank you!

tony_sologubov 04-09-2015 03:10 AM

Re: Customize Email & Invoce
 
Quote:

Originally Posted by Burpomatic
Hello Tony,

Yes JannieB's solution works, but I thought there could have been a more "direct" solution to correcting the "content-type" instead.

Thank you!


Oh, sure. You might want to contact your hosting team and ask them why Content-type is with small t there. Probably, they can fix it, but it does not guarantee the fix of the original problem.

Tony

JannieB 04-09-2015 04:51 AM

Re: Customize Email & Invoce
 
Hi Tony,

I am using Outlook as a mail client.
When I sent order emails to my gmail account they were rendered correctly, so clearly something to do with the way Outlook (and possibly other mail clients) interpret the message html. But then we all know that mail clients have yet to join us in the 21st Century ...!

Jan

tony_sologubov 04-09-2015 05:35 AM

Re: Customize Email & Invoce
 
Quote:

Originally Posted by JannieB
I am using Outlook as a mail client.
When I sent order emails to my gmail account they were rendered correctly, so clearly something to do with the way Outlook (and possibly other mail clients) interpret the message html. But then we all know that mail clients have yet to join us in the 21st Century ...!


Oh, yes, exactly http://stackoverflow.com/questions/7933112/quoted-printable-email-showing-equal-signs-in-certain-email-clients

I will ask the team to add a fix for it in the future release. It will not be in 5.2.4, but it will be definitely be in 5.2.5 or 5.2.


All times are GMT -8. The time now is 09:57 PM.

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