Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Faulty mail formatting on data export #93

Closed
stenno opened this issue Mar 28, 2019 · 2 comments
Closed

Faulty mail formatting on data export #93

stenno opened this issue Mar 28, 2019 · 2 comments

Comments

@stenno
Copy link

stenno commented Mar 28, 2019

When exporting data like products or product prices, the user gets an email with a link to the exported file. However, the markup of the mail is malformatted, the link cannot be clicked. Example from the markup:

<div class=3D"wrapper"><p>
    =
            Export performed successfully.
                71 product pri=
ces were exported.
                <a href=3D"example.com/admin/exp=
ort/download/export_2019_03_27_16_38_30_5c9ba706088cc.csv" target=3D"_blank=
">Download</a></p></div>

The mail client is thunderbird 60.6.1 (32-Bit) on Windows 10. The affected version is orocommerce 3.1.4-LTS

@stenno stenno changed the title Faulty mail formatting Faulty mail formatting on data export Mar 28, 2019
@mbessolov
Copy link
Member

@stenno please clarify what do you mean by "the link cannot be clicked", as this is perfectly valid markup for Content-Transfer-Encoding: quoted-printable, which is used in emails.

Here is the full source of an email on my test instance:

Message-ID: <82bb2884984e408e8bc49ba99b8ea923@swift.generated>
Date: Thu, 28 Mar 2019 06:04:37 -0700
Subject: Export result for job
 oro_importexport.pre_export.entity_export_to_csv.user_1
From: Oro <no-reply@mb5570.example>
To: admin@example.com
MIME-Version: 1.0
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

<style>
    @media (max-width: 480pt) {
        .wrapper{
           =
 width: 100% !important;
        }
    }
    a:hover {
        text=
-decoration: underline;
    }
</style><div class=3D"wrapper"><p>
    =
            Export performed successfully.
                12 customer us=
ers were exported.
                <a href=3D"http://commerce-crm-ee.dev-=
current.localhost/admin/export/download/64" target=3D"_blank">Download</a><=
/p></div>

This email is formatted as it should in email clients and the link is clickable.

@stenno
Copy link
Author

stenno commented Mar 28, 2019

@mbessolov Thanks for the swift reply.

I compared the markup to one of a validation result, where clicking works as expected, and noticed that the provided link in the export mail missed a 'http://' in front of the link. Our application URL is '<hostname>.com' instead of 'http://<hostname>.com'. Therefore, the link in the provided mail will not work.

So this seems like a configuration problem on our side. I am considering opening a feature request issue to let orocommerce handle those cases where there is no http:// resp. https://. This could probably be done by appending the protocol-relative '//' prefix if none is available. Any thoughts on this?

@stenno stenno closed this as completed Mar 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants