Skip to content
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

Refactor mailing #12050

Merged
merged 8 commits into from Nov 19, 2020
Merged

Refactor mailing #12050

merged 8 commits into from Nov 19, 2020

Conversation

SirDomin
Copy link
Contributor

Q A
Branch? master
Bug fix? no
New feature? no
BC breaks? no
Deprecations? not sure
Related tickets refactoring the way we handle emails implemented in #11754
License MIT

@SirDomin SirDomin requested a review from a team as a code owner November 17, 2020 13:15

final class SendOrderConfirmationHandlerSpec extends ObjectBehavior
{
function let(
Copy link
Contributor

Choose a reason for hiding this comment

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

can be in one line

@@ -66,7 +68,7 @@ public function __invoke(CompleteOrder $completeOrder): OrderInterface

$stateMachine->apply(OrderCheckoutTransitions::TRANSITION_COMPLETE);

$this->emailManager->sendConfirmationEmail($cart);
$this->messageBus->dispatch(new OrderCompletedEvent($orderTokenValue), [new DispatchAfterCurrentBusStamp()]);
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be good to add comment why you added that stamp here.

@Zales0123 Zales0123 added DX Issues and PRs aimed at improving Developer eXperience. Enhancement Minor issues and PRs improving the current solutions (optimizations, typo fixes, etc.). labels Nov 18, 2020
$emailManager->sendConfirmationEmail($order)->shouldBeCalled();
$orderCompleted = new OrderCompleted('COMPLETED_ORDER_TOKEN');

$eventBus->dispatch($orderCompleted, [new DispatchAfterCurrentBusStamp()])
Copy link
Member

Choose a reason for hiding this comment

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

I'm surprised, that it works. I would expect, that the second argument makes a problem with matching to the actual value.

src/Sylius/Bundle/ApiBundle/Event/OrderCompleted.php Outdated Show resolved Hide resolved
@GSadee GSadee merged commit 1192b36 into Sylius:master Nov 19, 2020
@GSadee
Copy link
Member

GSadee commented Nov 19, 2020

Thanks, @SirDomin! 🥇

GSadee added a commit that referenced this pull request Nov 19, 2020
This PR was merged into the 1.9-dev branch.

Discussion
----------

| Q               | A
| --------------- | -----
| Branch?         | master 
| Bug fix?        | no
| New feature?    | no
| BC breaks?      | no
| Deprecations?   | no
| Related tickets | #12050
| License         | MIT

<!--
 - Bug fixes must be submitted against the 1.7 or 1.8 branch (the lowest possible)
 - Features and deprecations must be submitted against the master branch
 - Make sure that the correct base branch is set

 To be sure you are not breaking any Backward Compatibilities, check the documentation:
 https://docs.sylius.com/en/latest/book/organization/backward-compatibility-promise.html
-->


Commits
-------

02ca9e6 adr how to send email
e537bd4 pr-fix
Comment on lines +81 to +82
<argument type="service" id="sylius_event.bus" />
<tag name="messenger.message_handler" bus="sylius_default.bus" />
Copy link
Member

Choose a reason for hiding this comment

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

I'm wondering about naming. Maybe we should have two busses:

  • sylius.command_bus
  • sylius.event_bus

and try to alias sylius_default.bus to sylius.command_bus if it is possilbe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DX Issues and PRs aimed at improving Developer eXperience. Enhancement Minor issues and PRs improving the current solutions (optimizations, typo fixes, etc.).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants