Skip to content

Add missing order_data array to EmailSender classes #27454

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 3 commits into from
Oct 15, 2020

Conversation

kassner
Copy link
Contributor

@kassner kassner commented Mar 26, 2020

Description

Magento 2.3.4 now recommends using scalar variables instead of objects within the email templates. Unfortunately, not all classes were migrated. For example, \Magento\Sales\Model\order\Email\Sender\ShipmentSender was given the new array, despite now it being deprecated, but its replacement, \Magento\Sales\Model\Order\Shipment\Sender\EmailSender did not.

This change was introduced in commits like fd721b1#diff-7b993c70d2652919564eeaf30afe7326. Several more do change the email templates to use order_data instead.

Manual testing scenarios

  1. Create a shipment email template using {{order_data.is_not_virtual}} (as opposed to {{order.is_not_virtual}});
  2. Send it programatically using \Magento\Sales\Model\Order\Shipment\Sender\EmailSender;

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)

Resolved issues:

  1. resolves [Issue] Add missing order_data array to EmailSender classes #29604: Add missing order_data array to EmailSender classes

@m2-assistant
Copy link

m2-assistant bot commented Mar 26, 2020

Hi @kassner. 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.4-develop instance - deploy vanilla Magento instance

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

Copy link
Contributor

@edenduong edenduong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @kassner: Could you please sign Adobe CLA? And arcording to Magento DOD, please cover your changes by Unit Test. Thank you very much!

@kassner kassner marked this pull request as ready for review May 29, 2020 08:41
@sidolov sidolov added Priority: P3 May be fixed according to the position in the backlog. Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. labels Aug 17, 2020
@sidolov
Copy link
Contributor

sidolov commented Aug 17, 2020

@magento create issue

@ghost ghost assigned sidolov Aug 27, 2020
@ghost ghost removed the Progress: review label Aug 27, 2020
@sidolov sidolov added Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Progress: review labels Aug 27, 2020
@magento-engcom-team
Copy link
Contributor

Hi @sidolov, thank you for the review.
ENGCOM-8087 has been created to process this Pull Request

@ghost ghost removed the Progress: review label Sep 12, 2020
@magento-engcom-team
Copy link
Contributor

Hi @edenduong, thank you for the review.
ENGCOM-8087 has been created to process this Pull Request

@engcom-Delta engcom-Delta self-assigned this Sep 30, 2020
@engcom-Delta
Copy link
Contributor

@magento run all tests

@engcom-Delta
Copy link
Contributor

engcom-Delta commented Oct 2, 2020

✔️ QA passed
Manual testing scenario:

  • Create email template for invoice with additional node in template
    image
  • Set template for Invoice Email Template and Invoice Email Template for Guest
  • Order simple product as guest
  • Create invoice for order
  • Send invoice email programatically using Magento\Sales\Model\Order\Invoice\Sender\EmailSender

Result:
Before:
No customer name(depends on order_data.customer_name) and shipping address(depends on order_data.is_not_virtual) in email for simple product
image

✔️ After:
Customer name, custom node and shipping information is displayed in invoice email for simple product
image

@engcom-Delta
Copy link
Contributor

Note: Functional Tests B2B and Functional Tests EE are failed

@engcom-Charlie engcom-Charlie self-assigned this Oct 5, 2020
@engcom-Charlie engcom-Charlie added the QA: Ready to add to Regression Scope Should be analyzed and added to Regression Testing Scope(if applicable) label Oct 8, 2020
@engcom-Delta engcom-Delta added QA: Added to Regression Scope Scenario was analysed and added to Regression Testing Scope and removed QA: Ready to add to Regression Scope Should be analyzed and added to Regression Testing Scope(if applicable) labels Oct 9, 2020
@engcom-Delta
Copy link
Contributor

Note: Automation tests are passed

@m2-assistant
Copy link

m2-assistant bot commented Oct 15, 2020

Hi @kassner, 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Component: Sales Priority: P3 May be fixed according to the position in the backlog. Progress: accept QA: Added to Regression Scope Scenario was analysed and added to Regression Testing Scope Release Line: 2.4 Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[Issue] Add missing order_data array to EmailSender classes
6 participants