Skip to content

[2.2][Backport] Transfer Encoding of emails changed to QUOTED-PRINTABLE #23650

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

Merged
merged 1 commit into from
Jul 15, 2019
Merged

[2.2][Backport] Transfer Encoding of emails changed to QUOTED-PRINTABLE #23650

merged 1 commit into from
Jul 15, 2019

Conversation

gwharton
Copy link
Contributor

@gwharton gwharton commented Jul 10, 2019

Original PR (*)

  1. [2.3] Transfer Encoding of emails changed to QUOTED-PRINTABLE #23649: [2.3] Transfer Encoding of emails changed to QUOTED-PRINTABLE

Description (*)

When Magento used Zend Framework 1 for emails, MIME emails were sent with Transfer Encoding set to QUOTED-PRINTABLE. This means that emails with long lines (particularly emails with large inline css) are encoded properly. This can be confirmed by running tests under 2.2.7.

When Magento switched to Zend Framework 2, the default Transfer Encoding was set to 8-bit. This emails with long lines were being rejected by some mail servers as they were not encoded quoted-printable as expected.

Magento 2.2.8+ and 2.3.0+ are affected by this.

This PR changes the default encoding of all MIME emails to quoted-printable.

Fixed Issues (if relevant)

  1. Mime parts of email are no more encoded with quoted printable #23643: Mime parts of email are no more encoded with quoted printable

Manual testing scenarios (*)

Backend
=======
Marketing -> Email Templates -> Add New Template
    Template Name = Newsletter Success Plain
    Subject = Success Subject
    Template Content = Success Body
    Convert to Plain Text
    Save Template
Marketing -> Email Templates -> Add New Template
    Template Name = Newsletter Success Html
    Subject = Success Subject
    Template Content = <html><body>Success Body</body></html>
    Save Template
Store -> Configuration -> General -> Store Email Addresses
    General Contact
        Sender Name = Owner Name
        Sender Email = [email protected]
Store -> Configuration -> Customers -> Newsletter -> Subscription Options
    Success Email Template = Newsletter Success Plain

Frontend
========
Subscribe to newsletter

Ensure email received contains the following headers

MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable

Backend
=======
Store -> Configuration -> Customers -> Newsletter -> Subscription Options
    Success Email Template = Newsletter Success Html

Frontend
========
Subscribe to newsletter

Ensure email received contains the following headers

MIME-Version: 1.0
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: quoted-printable

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

@m2-assistant
Copy link

m2-assistant bot commented Jul 10, 2019

Hi @gwharton. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.2-develop instance - deploy vanilla Magento instance

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

Added Content-Disposition: inline to all MIME emails

Implementation now matches previous ZF1 implementation
@magento-engcom-team
Copy link
Contributor

Hi @sivaschenko, thank you for the review.
ENGCOM-5437 has been created to process this Pull Request
✳️ @sivaschenko, could you please add one of the following labels to the Pull Request?

Label Description
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests
Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests
Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests

@engcom-Delta
Copy link
Contributor

✔️ QA passed

@m2-assistant
Copy link

m2-assistant bot commented Jul 15, 2019

Hi @gwharton, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@magento-engcom-team magento-engcom-team added this to the Release: 2.2.10 milestone Jul 15, 2019
@gwharton gwharton deleted the 2.2-develop-quoted-printable branch July 15, 2019 15:06
@VladimirZaets VladimirZaets added the Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests label Sep 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests Component: Mail Progress: accept Release Line: 2.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants