magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

Email templates 2.4.3-p2 wrong var

Open leonhelmus opened this issue 2 years ago • 7 comments

Preconditions (*)

  1. Magento 2.4.3-p2 open source / enterprise.
  2. Php 7.4

Steps to reproduce (*)

  1. Load a creditmemo_new email from the backend.
  2. See for example: https://github.com/magento/magento2/blob/610f7f51faa94639da29f8001aded7559f114c54/app/code/Magento/Sales/view/frontend/email/creditmemo_new.html#L12
  3. Check the vars: <!--@vars {
  4. This applies for all email templates in Magento_Sales module.

Expected result (*)

  1. layout handle is correct. like: layout handle="sales_email_order_creditmemo_items" creditmemo_id=$creditmemo_id order_id=$order_id:"Credit Memo Items Grid"

Actual result (*)

  1. Layout handle is still wrong. like "layout handle=\"sales_email_order_creditmemo_items\" creditmemo=$creditmemo order=$order":"Credit Memo Items Grid",

Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

  • [ ] 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.
  • [x] 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”.

leonhelmus avatar Apr 25 '22 12:04 leonhelmus

Hi @leonhelmus. Thank you for your report. To speed up processing of this issue, make sure that you provided the following information:

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

Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

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

For more details, review the Magento Contributor Assistant documentation.

Add a comment to assign the issue: @magento I am working on this

To learn more about issue processing workflow, refer to the Code Contributions.


:warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

:clock10: You can find the schedule on the Magento Community Calendar page.

:telephone_receiver: 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.

:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

m2-assistant[bot] avatar Apr 25 '22 12:04 m2-assistant[bot]

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: :point_down:

  • [ ] 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.

  • [ ] 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.

m2-assistant[bot] avatar Jul 01 '22 11:07 m2-assistant[bot]

Verified the issue on Magento 2.4-develop branch and the issue is reproducible. As per Magento devdocs, layout handle should be: layout handle="sales_email_order_creditmemo_items" creditmemo_id=$creditmemo_id order_id=$order_id:"Credit Memo Items Grid"

engcom-November avatar Jul 01 '22 11:07 engcom-November

:white_check_mark: Jira issue https://jira.corp.magento.com/browse/AC-4403 is successfully created for this GitHub issue.

github-jira-sync-bot avatar Jul 01 '22 11:07 github-jira-sync-bot

:white_check_mark: 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.

m2-assistant[bot] avatar Jul 01 '22 11:07 m2-assistant[bot]

@magento I am working on this

artskirk avatar Jul 21 '22 08:07 artskirk

Seems like the following example: https://github.com/magento/magento2/blob/610f7f51faa94639da29f8001aded7559f114c54/app/code/Magento/Sales/view/frontend/email/creditmemo_new.html#L12 is correct and used together with escape quotes. The layout handle statement is already implemented on line 87: https://github.com/magento/magento2/blob/610f7f51faa94639da29f8001aded7559f114c54/app/code/Magento/Sales/view/frontend/email/creditmemo_new.html#L87

Please, provide the steps where this statement causes the Magento issue.

artskirk avatar Jul 21 '22 21:07 artskirk

Hi @leonhelmus , "layout handle" is correctly mentioned on line 87: magento2/app/code/Magento/Sales/view/frontend/email/creditmemo_new.html and escape quotes are added in commented section: <!--@vars { for formatting purpose which cannot be removed. We are closing this issue as this statement does not effect Magento behavior. Kindly reopen / create new issue if you are still facing any issues. Thank you.

engcom-November avatar Aug 16 '22 12:08 engcom-November

@leonhelmus How did you end up fixing this? Looks like it's still an issue even on Vanilla 2.4.5-p1

pmonosolo avatar Dec 14 '22 00:12 pmonosolo

@pmonosolo just use the var in the actual result of my description of this issue.at the moment they send a scalar object which isn't possible anymore from version >2.4.3-p3.

leonhelmus avatar Dec 14 '22 00:12 leonhelmus

@pmonosolo just use the var in the actual result of my description of this issue. @engcom-November I wasn't talking about the handle, but about the arguments that it added are scalar.

leonhelmus avatar Dec 14 '22 00:12 leonhelmus

  1. layout handle="sales_email_order_creditmemo_items" creditmemo_id=$creditmemo_id order_id=$order_id:"Credit Memo Items Grid"

@leonhelmus So this would be the correct output?

image

pmonosolo avatar Dec 14 '22 00:12 pmonosolo

@pmonosolo should be yes.

leonhelmus avatar Dec 14 '22 00:12 leonhelmus

@pmonosolo should be yes. Its the same as this:             {{layout handle="sales_email_order_creditmemo_items" creditmemo_id=$creditmemo_id order_id=$order_id}}

leonhelmus avatar Dec 14 '22 00:12 leonhelmus

@pmonosolo should be yes.

Hmmm, not working for me :(

When sending an email the items are just empty. The credit memo object just outputting NULL

pmonosolo avatar Dec 14 '22 00:12 pmonosolo

Here is my full VARS section:

image

pmonosolo avatar Dec 14 '22 00:12 pmonosolo

@pmonosolo maybe a third party module which screws it up. Or did you already check if the client overwritten the email templates from the backend. Or app/design. In default Magento this does work. So probably project specific i would say.

leonhelmus avatar Dec 14 '22 00:12 leonhelmus

Y

@pmonosolo maybe a third party module which screws it up. Or did you already check if the client overwritten the email templates from the backend

Yes, I'm using both Yireo email tester and the SEND button - both output no items.

image

Using Both New Credit Memo and New Credit Memo (Magento / Luma).

pmonosolo avatar Dec 14 '22 00:12 pmonosolo

@engcom-November Can you please try just sending the Credit Memo email using the default template?

Does the email arrive with items + taxes?

pmonosolo avatar Dec 14 '22 00:12 pmonosolo