Skip to content

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

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

Open
1 of 5 tasks
rns-nonaka-enagic opened this issue Apr 25, 2025 · 8 comments
Assignees
Labels
Area: Order Component: Email Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Reported on 2.4.7-p5 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch

Comments

@rns-nonaka-enagic
Copy link

Preconditions and environment

  • Magento version
     2.4.7-p5
  • Multi-store setup with different configurations for shipment emails
  • Default store has shipment emails disabled
  • Secondary store has shipment emails enabled

Steps to reproduce

  1. Set up a multi-store configuration where the default store has shipment emails disabled
  2. Create an order in a secondary store 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

Expected result

The system should send a shipment confirmation email as it is enabled in the store configuration where the order was placed.

Actual result

No shipment confirmation email is sent because the system checks the default store configuration instead of the store configuration where the order was placed.

Additional information

Root cause analysis

In Save.php at line 170, the shipment email sending condition is checked using:

if (!empty($data['send_email']) && $this->salesData->canSendNewShipmentEmail())

The canSendNewShipmentEmail() method is called without passing the store ID parameter. This causes the system to check the configuration of the default store instead of the store where the order was placed.

The correct implementation should pass the order's store ID to this method:

if (!empty($data['send_email']) && $this->salesData->canSendNewShipmentEmail($shipment->getOrder()->getStoreId()))

This issue affects multi-store setups where different stores have different email configuration settings.

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
Copy link

m2-assistant bot commented Apr 25, 2025

Hi @rns-nonaka-enagic. Thank you for your report.
To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce.


Join Magento Community Engineering Slack and ask your questions in #github channel.
⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
🕙 You can find the schedule on the Magento Community Calendar page.
📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

Copy link

m2-assistant bot commented Apr 25, 2025

Hi @engcom-November. 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).
  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
  • 3. Add Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
  • 4. Verify that the issue is reproducible on 2.4-develop branch
    Details- If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.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. Add label Issue: Confirmed once verification is complete.
  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-November engcom-November added the Reported on 2.4.7-p5 Indicates original Magento version for the Issue report. label Apr 28, 2025
@engcom-November
Copy link
Contributor

Hello @rns-nonaka-enagic ,

Thank you for your report and collaboration.

We attempted to reproduce the issue in our latest version 2.4 develop but were unable to do so. Please find the attached screenshot for reference.

Image

Image

Image

Steps to Reproduce:

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

We followed the provided preconditions and steps but did not encounter any issues. Could you please recheck in the latest version of Magento and let us know if we are missing any steps to reproduce this issue?

Therefore, we are marking this ticket as "Issue: Needs Update."

Thank you!

@engcom-November engcom-November added the Issue: needs update Additional information is require, waiting for response label Apr 28, 2025
@ct-prd-projects-boards-automation ct-prd-projects-boards-automation bot moved this from Ready for Confirmation to Needs Update in Issue Confirmation and Triage Board Apr 28, 2025
@rns-nonaka-enagic
Copy link
Author

rns-nonaka-enagic commented Apr 30, 2025

@engcom-November
We have confirmed the issue on the 2.4.7-develop environment.
The detailed steps to reproduce are as follows:

First, create two stores.
In this example, we use "Main Store" and "US Store".
Please make sure to use a store from a different website.
This difference is likely the key factor determining whether the issue can be reproduced or not.

as the system will fall back to the settings of the Default Website, Default Store, and Default Store View.
Image

Then, disable the Shipment email in the Main Website.
Image

Enable the Shipment email in the US Website.
Image

Next, place an order from the frontend.
Image

After that, open the order in the backend and perform the shipment.
Image

During the shipment, check the Email Copy of Shipment option and select Submit Shipment.
Note: The issue only occurs with this operation.
Image

At this point, the Shipment email will not be sent, which confirms the problem.

Cause in the source code
The root cause is in the following file:
vendor/magento/module-shipping/Controller/Adminhtml/Order/Shipment/Save.php
Line 170
Image

Since the Store ID is not specified, it falls back to the default store configuration.

@engcom-November
Copy link
Contributor

Hello @rns-nonaka-enagic ,

Thank you for your report and collaboration.

We attempted to reproduce the issue in the latest 2.4-develop instances, We are able to reproduce the issue. Please refer to the attached screenshot for details.

Image
Image
Image
Image

Steps to Reproduce:

  1. Create two stores.
  2. Disable the Shipment email in the Main Website.
  3. Enable the Shipment email in the US Website.
  4. Place the order from frontend
  5. In backend please perform the shipment.
  6. During the shipment, check the Email Copy of Shipment option and select Submit Shipment.

We followed the preconditions and steps as provided and encountered the issue.

Therefore, we are marking this ticket as "Issue: Confirmed."

Thank you!

@engcom-November engcom-November added Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Area: Order Component: Email Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed and removed Issue: needs update Additional information is require, waiting for response labels Apr 30, 2025
@github-jira-sync-bot
Copy link

✅ Jira issue https://jira.corp.adobe.com/browse/AC-14563 is successfully created for this GitHub issue.

Copy link

m2-assistant bot commented Apr 30, 2025

✅ Confirmed by @engcom-November. Thank you for verifying the issue.
Issue Available: @engcom-November, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@engcom-Hotel engcom-Hotel added the Priority: P2 A defect with this priority could have functionality issues which are not to expectations. label May 6, 2025
@ct-prd-projects-boards-automation ct-prd-projects-boards-automation bot moved this to Ready for Development in High Priority Backlog May 6, 2025
@KrasnoshchokBohdan
Copy link
Contributor

@magento I am working on this

KrasnoshchokBohdan added a commit to KrasnoshchokBohdan/magento2 that referenced this issue May 8, 2025
…r view despite being enabled in store configuration

- adding storeId to canSendNewShipmentEmail method
KrasnoshchokBohdan added a commit to KrasnoshchokBohdan/magento2 that referenced this issue May 8, 2025
…r view despite being enabled in store configuration

- copyright
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Order Component: Email Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Reported on 2.4.7-p5 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch
Projects
Status: Ready for Development
Development

No branches or pull requests

5 participants