Closed srenon closed 4 years ago
Code snippet provided seems to be Windows-specific, do you face with any problems on a supported operating system?
UPD: oh, sorry, breakpoint is outside of condition. Disregard my question.
Just to clarify, the bigger issue is that you can not get the store scope (store id, etc), because it will always be the default regardless of what store you are resending the email from.
@srenon, thank you for your report. We've created internal ticket(s) MAGETWO-83361 to track progress on the issue.
@magefan thank you for joining. Please accept team invitation here and self-assign the issue.
Unfortunately, we are archiving this ticket now as it did not get much attention from both Magento Community and Core developers for an extended period. This is done in an effort to create a quality, community-driven backlog which will allow us to allocate the required attention more easily.
Please feel free to comment or reopen according to the Issue reporting guidelines
the ticket if you are still facing this issue on the latest 2.x-develop
branch. Thank you for collaboration.
Preconditions
This issue is not that obvious in core Magento but does exist and become a bigger issue when using third party SMTP extension https://github.com/magepal/magento2-gmailsmtpapp (I.e https://github.com/magepal/magento2-gmailsmtpapp/issues/75 https://github.com/magepal/magento2-gmailsmtpapp/issues/49) or any code/plugin that needs to know the correct store or ScopeConfigInterface during code execution.
Basic steps to reproduce (but this issue is much deeper and does affect other areas)
Create a multi-store environment
Set different value in each store for the "port" (i.e 251 & 252)
Place an order in each store
Set a breakpoint in /app/code/Magento/Email/Model/Plugin/WindowsSmtpConfig.php
$this->config->getValue(self::XML_SMTP_PORT)
Expected result
Actual result
In Magento1.x you use a combination of startEnvironmentEmulation() and setting the storeId to prevent this issue.
https://github.com/OpenMage/magento-mirror/blob/magento-1.7/app/code/core/Mage/Sales/Model/Order.php
https://github.com/OpenMage/magento-mirror/blob/magento-1.9/app/code/core/Mage/Adminhtml/controllers/Sales/OrderController.php#L135