Skip to content

Email encoding leads to problems in several clients - add ENCODING_QUOTEDPRINTABLE #22065

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

Closed
klein0r opened this issue Mar 30, 2019 · 11 comments
Closed
Assignees
Labels
Component: Framework/Mail Event: cdkyiv2019 good first issue Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release

Comments

@klein0r
Copy link
Contributor

klein0r commented Mar 30, 2019

Preconditions (*)

  1. Install Magento 2.2.8 or 2.3+
  2. PHP 7.1.26

Steps to reproduce (*)

  1. Create an email template with umlauts or other chars like ö ä ü ß €
  2. Send the email

Expected result (*)

  1. Readable email

Actual result (*)

  1. Chars are not displayed correctly since ZF2 mail

Screenshot 2019-03-30 at 20 33 46

Solution: Add ENCODING_QUOTEDPRINTABLE as encoding to Zend_Mime_Parts

vendor/magento/framework/Mail/Message.php:168

    private function createHtmlMimeFromString($htmlBody)
    {
        $htmlPart = new Part($htmlBody);
        $htmlPart->setEncoding(\Zend\Mime\Mime::ENCODING_QUOTEDPRINTABLE);
        $htmlPart->setCharset($this->zendMessage->getEncoding());
        $htmlPart->setType(Mime::TYPE_HTML);
        $mimeMessage = new \Zend\Mime\Message();
        $mimeMessage->addPart($htmlPart);
        return $mimeMessage;
    }
@m2-assistant
Copy link

m2-assistant bot commented Mar 30, 2019

Hi @klein0r. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento-engcom-team give me 2.3-develop instance - upcoming 2.3.x release

For more details, please, review the Magento Contributor Assistant documentation.

@klein0r do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Mar 30, 2019
@gwharton
Copy link
Contributor

gwharton commented Apr 2, 2019

In addition to the above, since 2.2.8, and presumably in 2.3 plain text emails are no longer sent as MIME, and so also do not display character encoding properly. See #22103

@ghost ghost self-assigned this Apr 8, 2019
@m2-assistant
Copy link

m2-assistant bot commented Apr 8, 2019

Hi @engcom-backlog-nazar. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • 6. Add label Issue: Confirmed once verification is complete.

  • 7. Make sure that automatic system confirms that report has been added to the backlog.

@ghost ghost added Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Component: Framework/Mail Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release good first issue Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Apr 8, 2019
@ghost ghost removed their assignment Apr 8, 2019
@magento-engcom-team magento-engcom-team added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Apr 8, 2019
@magento-engcom-team
Copy link
Contributor

✅ Confirmed by @engcom-backlog-nazar
Thank you for verifying the issue. Based on the provided information internal tickets MAGETWO-99083, MAGETWO-99084 were created

Issue Available: @engcom-backlog-nazar, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@rvoronovmeticulosity
Copy link

#cdkyiv2019

@magento-engcom-team
Copy link
Contributor

@rvoronovmeticulosity thank you for joining. Please accept team invitation here and self-assign the issue.

@m2-assistant
Copy link

m2-assistant bot commented Apr 13, 2019

Hi @rvoronovmeticulosity. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:

  • 1. Add/Edit Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 2. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 3. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • 4. If the issue is not relevant or is not reproducible any more, feel free to close it.

@rvoronovmeticulosity
Copy link

Can't reproduce the bug. Not actually anymore

@klein0r
Copy link
Contributor Author

klein0r commented Apr 13, 2019

@rvoronovmeticulosity Which email clients have been tested?

@Nazar65
Copy link
Member

Nazar65 commented Apr 13, 2019

@rvoronovmeticulosity lets just close issue if you not able to reproduce 👍

@gwharton
Copy link
Contributor

Unable to reproduce on Thunderbird 60.6.1

simon-letch pushed a commit to dotmailer/dotmailer-magento2-extension that referenced this issue Apr 16, 2019
**This is a workaround for encoding issue until Magento resolves bug**
magento/magento2#22065
magento/magento2#22103

**Change will effect Magento 2.2.8 and 2.3.+**
Because of ZF v2 usage in these versions setEncoding on message should fix encoding overall (setEncoding fixes encoding issue in subject) but because of ZF v2 bug have to fix encoding separately on body.
zendframework/zendframework#6841
zendframework/zendframework#5708
zendframework/zendframework#4917

**To test:**
- Test both email types text and html
- Test in Magento 2.3.*
- Test in Magento 2.2.8
- Test in Magento < 2.2.8
- Test using our Email Template mapped and our SMTP enabled
- Test using Magento template and our SMTP enabled
- Test using our SMTP disabled

Related work items: #86368
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Framework/Mail Event: cdkyiv2019 good first issue Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

No branches or pull requests

5 participants