Skip to content

Graphql events.xml is added for quote submit succes to trigger sales … #28352

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

Merged

Conversation

cyildirim
Copy link
Member

@cyildirim cyildirim commented May 24, 2020

…email

Description (*)

Sales email is not sent after order placement through graphql requests. The fix includes event that triggers sales emails after order placement.

Related Pull Requests

Fixed Issues (if relevant)

#28124 is fixed with this PR.

  1. Fixes magento/magento2#<issue_number>

Manual testing scenarios (*)

  1. set sales_email/order/enabled to yes
  2. Follow official graphql order placement documentto place order
  3. Observe order confirmation email is received

Questions or comments

I haven't seen any test related to this feature as it's used with soap and rest events.xml. I am happy to add related test if required.

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)
  • All automated tests passed successfully (all builds are green)

@m2-assistant
Copy link

m2-assistant bot commented May 24, 2020

Hi @cyildirim. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

❗ 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

You can find more information about the builds here

ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review.

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

@cyildirim
Copy link
Member Author

@magento run all tests

@cyildirim
Copy link
Member Author

@magento run Functional Tests B2B

Copy link
Contributor

@rogyar rogyar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @cyildirim. Thank you for your collaboration.

Please note, we already have the same observer registered (for the same event) in the Quote module.

https://github.com/magento/magento2/blob/2.3/app/code/Magento/Quote/etc/frontend/events.xml

As there result, the observer with the module that is being loaded later in the modules loading sequence will override the previous declaration. The existing issue will not be fixed in that way

@ghost ghost assigned rogyar May 25, 2020
@rogyar rogyar self-requested a review May 25, 2020 12:19
@rogyar
Copy link
Contributor

rogyar commented May 25, 2020

My fault. I've just noticed that the previous observer is registered for all areas except the GraphQl.
Could I ask you to cover this case with integration or API-functional test, please?

I see the integration tests as the following, you are emulating the GraphQl area and triggering the sales_model_service_quote_submit_success event. Then you assert that the corresponding observer is being invoked.

Thank you!

@rogyar rogyar added Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests Award: bug fix labels May 25, 2020
@engcom-Charlie engcom-Charlie self-assigned this May 27, 2020
@engcom-Charlie
Copy link
Contributor

@magento run all tests

@engcom-Charlie
Copy link
Contributor

Hi @rogyar, please review the test coverage.

@nrkapoor nrkapoor added this to the 2.4.1 milestone Jun 11, 2020
@rogyar rogyar added Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Award: test coverage and removed Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests labels Jun 14, 2020
@magento-engcom-team
Copy link
Contributor

Hi @rogyar, thank you for the review.
ENGCOM-7683 has been created to process this Pull Request

@nrkapoor nrkapoor modified the milestones: 2.4.1, 2.4.2 Aug 15, 2020
@magento-engcom-team magento-engcom-team merged commit a2498b1 into magento:2.4-develop Oct 28, 2020
@m2-assistant
Copy link

m2-assistant bot commented Oct 28, 2020

Hi @cyildirim, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants