magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

magento/magento2#39861: Shipment email not sent when submitted from Admin Order view despite being enabled in store configuration

Open KrasnoshchokBohdan opened this issue 6 months ago • 4 comments

Description (*)

\Magento\Shipping\Controller\Adminhtml\Order\Shipment\Save::execute

if (!empty($data['send_email']) && $this->salesData->canSendNewShipmentEmail()) {
                $this->shipmentSender->send($shipment);
 }

without the right 'store id' checks only default config value

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes https://github.com/magento/magento2/issues/39861

Manual testing scenarios (*)

  1. Set up a multi-website configuration where the default has shipment emails disabled
  2. Create an order in a secondary website that has shipment emails enabled
  3. Go to Admin > Sales > Orders
  4. Open the order from the secondary store
  5. Click on "Ship" button
  6. Fill in shipment details and check "Email Copy of Shipment"
  7. Submit the shipment

Questions or comments

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)
  • [ ] README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • [ ] All automated tests passed successfully (all builds are green)

KrasnoshchokBohdan avatar May 08 '25 12:05 KrasnoshchokBohdan

Hi @KrasnoshchokBohdan. Thank you for your contribution! Here are some useful tips on how you can test your changes using Magento test environment. :exclamation: Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s) For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names.

Allowed build names are:
  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests
  13. Semantic Version Checker

You can find more information about the builds here :information_source: Run only required test builds during development. Run all test builds before sending your pull request for review.


For more details, review the Code Contributions documentation. Join Magento Community Engineering Slack and ask your questions in #github channel.

m2-assistant[bot] avatar May 08 '25 12:05 m2-assistant[bot]

@magento run all tests

KrasnoshchokBohdan avatar May 08 '25 12:05 KrasnoshchokBohdan

@magento run all tests

KrasnoshchokBohdan avatar May 08 '25 16:05 KrasnoshchokBohdan

@magento run all tests

KrasnoshchokBohdan avatar May 26 '25 09:05 KrasnoshchokBohdan

@magento run all tests

engcom-Hotel avatar Jul 03 '25 06:07 engcom-Hotel

@magento run all tests

KrasnoshchokBohdan avatar Jul 05 '25 06:07 KrasnoshchokBohdan

@magento run all tests

engcom-Hotel avatar Jul 15 '25 07:07 engcom-Hotel

@magento run all tests

engcom-Bravo avatar Jul 22 '25 09:07 engcom-Bravo

Hi @KrasnoshchokBohdan,

Thanks for the collaboration & contribution!

:heavy_check_mark: QA Passed

Preconditions:

  • Install fresh Magento 2.4-develop

Steps to reproduce

  • Set up a multi-website configuration where the default has shipment emails disabled
  • Create an order in a secondary website that has shipment emails enabled
  • Go to Admin > Sales > Orders
  • Open the order from the secondary store
  • Click on "Ship" button
  • Fill in shipment details and check "Email Copy of Shipment"
  • Submit the shipment

Before: :heavy_multiplication_x: 

Screenshot 2025-07-22 at 3 17 03 pm

No mails regarding shipments

After: :heavy_check_mark:

Screenshot 2025-07-22 at 3 22 37 pm

Builds are failed. Hence, moving this PR to Extended Testing.

Thanks.

engcom-Bravo avatar Jul 22 '25 11:07 engcom-Bravo

@magento run all tests

engcom-Charlie avatar Jul 24 '25 06:07 engcom-Charlie

@magento run Functional Tests CE, Integration Tests, Unit Tests

engcom-Charlie avatar Jul 24 '25 09:07 engcom-Charlie

@magento run Integration Tests

engcom-Charlie avatar Jul 24 '25 13:07 engcom-Charlie

@magento run Integration Tests

engcom-Charlie avatar Jul 25 '25 07:07 engcom-Charlie

The build is green now, hence moving this to Merge In Progress. image

engcom-Charlie avatar Jul 25 '25 10:07 engcom-Charlie

@magento run all tests

engcom-Hotel avatar Aug 06 '25 10:08 engcom-Hotel

Moving it to Merge in progress

engcom-Hotel avatar Aug 08 '25 07:08 engcom-Hotel