Skip to content

Commit

Permalink
minor #158 Improved: OrderPaymentLinkSender (igormukhingmailcom)
Browse files Browse the repository at this point in the history
This PR was merged into the 1.1-dev branch.

Discussion
----------

Now created `Order` passed to email template to be able to render breakdown / user can see what he pays for

Commits
-------

a6a3692 Improved: OrderPaymentLinkSender
  • Loading branch information
GSadee authored Feb 25, 2022
2 parents 4351c22 + a6a3692 commit 2386921
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
9 changes: 8 additions & 1 deletion spec/Sender/OrderPaymentLinkSenderSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,14 @@ function it_sends_payment_link_for_order_to_the_customer(
$customer->getEmail()->willReturn('[email protected]');

$sender
->send('order_created_in_admin_panel', ['[email protected]'], ['paymentLink' => 'http://payment-link.com'])
->send(
'order_created_in_admin_panel',
['[email protected]'],
[
'order' => $order,
'paymentLink' => 'http://payment-link.com',
]
)
->shouldBeCalled()
;

Expand Down
5 changes: 4 additions & 1 deletion src/Sender/OrderPaymentLinkSender.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ public function sendPaymentLink(OrderInterface $order): void
->send(
'order_created_in_admin_panel',
[$order->getCustomer()->getEmail()],
['paymentLink' => $paymentDetails['payment-link']]
[
'order' => $order,
'paymentLink' => $paymentDetails['payment-link'],
]
)
;
}
Expand Down

0 comments on commit 2386921

Please sign in to comment.