Skip to content

Commit

Permalink
Pass email data as modifiers factors
Browse files Browse the repository at this point in the history
  • Loading branch information
Zales0123 committed Jan 3, 2023
1 parent 8f3cb39 commit 898cb97
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Component/Sender/Sender.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function send(

$email = $this->provider->getEmail($code);
if ($this->emailModifier !== null) {
$email = $this->emailModifier->modify($email);
$email = $this->emailModifier->modify($email, $data);
}

if (!$email->isEnabled()) {
Expand Down
6 changes: 3 additions & 3 deletions src/Component/spec/Sender/SenderSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,14 @@ function it_sends_a_modified_email_with_cc_and_bcc_through_the_adapter(

$provider->getEmail('bar')->willReturn($email);

$emailModifier->modify($email)->shouldBeCalled()->willReturn($email);
$data = ['foo' => 2];

$emailModifier->modify($email, $data)->shouldBeCalled()->willReturn($email);

$email->isEnabled()->willReturn(true);
$email->getSenderAddress()->willReturn('[email protected]');
$email->getSenderName()->willReturn('Modified sender');

$data = ['foo' => 2];

$rendererAdapter->render($email, ['foo' => 2])->willReturn($renderedEmail);
$senderAdapter->sendWithCC(
['[email protected]'],
Expand Down

0 comments on commit 898cb97

Please sign in to comment.