Magento2: Logo url contains "/pub" in asynchronous command line generated emails

Created on 26 Feb 2020  路  10Comments  路  Source: magento/magento2

Preconditions (*)

  1. Magento 2.3.4

Steps to reproduce (*)

  1. Magento store is running on the webserver docroot /path_to_magento/pub
  2. Logo image selected in Content->Design->Configuration->Transactional Emails->Logo Image [design/email/logo db setting] (let's assume the value is "default/mylogo.png")
  3. Run an email with a template with logo tag with variable {{var logo_url}} from command line or by Magento cron (email sent from any http(s) action will work because webserver is calling /path_to_magento/pub/index.php while Magento cron use /path_to_magento/index.php).

Expected result (*)

  1. Received email with visible remote image
  2. Remote image logo has url https://store_url/media/email/logo/default/mylogo.png

Actual result (*)

  1. Cannot load remote image logo
  2. Remote image logo has url https://store_url/pub/media/email/logo/default/mylogo.png which is unreachable from the webserver.
Email Sales Clear Description Confirmed Format is valid Ready for Work Reported on 2.3.4 Reproduced on 2.3.x Reproduced on 2.4.x

Most helpful comment

Hi @textarea,

When the webserver is configured to serve the Magento app from the /pub directory, it is necessary to add the node below to the app/etc/env.php file.

'directories' => [
    'document_root_is_pub' => true
]

This issue should not be reproducible afterward.

We are working to update the documentation with this information.

All 10 comments

Hi @textarea. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • [x] Summary of the issue
  • [x] Information on your environment
  • [x] Steps to reproduce
  • [x] Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

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

@textarea do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • [x] yes
  • [ ] no

Hi @dmytro-ch. 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: :point_down:

  • [x] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.
  • [x] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • [ ] 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • [ ] 4. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - 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.

:white_check_mark: Confirmed by @dmytro-ch
Thank you for verifying the issue. Based on the provided information internal tickets MC-31958 were created

Issue Available: @dmytro-ch, _You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself._

Hello, @textarea, thank you for the report.

Confirmed, the issue is reproducible in 2.4-develop branch.
Screenshot 2020-02-27 at 12 08 16

Hi @vovsky. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:

  • [ ] 1. Add/Edit Component: XXXXX label(s) to the ticket, indicating the components it may be related to.
  • [ ] 2. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - 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_!

  • [ ] 3. If the issue is not relevant or is not reproducible any more, feel free to close it.


Hi @thiaramus. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:

  • [ ] 1. Add/Edit Component: XXXXX label(s) to the ticket, indicating the components it may be related to.
  • [ ] 2. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - 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_!

  • [ ] 3. If the issue is not relevant or is not reproducible any more, feel free to close it.


Hi @textarea,

When the webserver is configured to serve the Magento app from the /pub directory, it is necessary to add the node below to the app/etc/env.php file.

'directories' => [
    'document_root_is_pub' => true
]

This issue should not be reproducible afterward.

We are working to update the documentation with this information.

Hi @thiaramus,

thanks, I confirm that the issue is not reproducible after adding that setting.
Regards

@thiaramus: next to some documentation, it would also be nice if this could be set automatically during Magento's installation, like with an additional flag in the bin/magento setup:install command for example, so this can be automated instead of having to do it manually.

Was this page helpful?
0 / 5 - 0 ratings