1 | <?php |
||
24 | final class EmailContext implements Context |
||
25 | { |
||
26 | /** @var SharedStorageInterface */ |
||
27 | private $sharedStorage; |
||
28 | |||
29 | /** @var EmailCheckerInterface */ |
||
30 | private $emailChecker; |
||
31 | |||
32 | /** @var TranslatorInterface */ |
||
33 | private $translator; |
||
34 | |||
35 | public function __construct( |
||
44 | |||
45 | /** |
||
46 | * @Then it should be sent to :recipient |
||
47 | * @Then the email with contact request should be sent to :recipient |
||
48 | */ |
||
49 | public function anEmailShouldBeSentTo(string $recipient): void |
||
53 | |||
54 | /** |
||
55 | * @Then an email with reset token should be sent to :recipient |
||
56 | * @Then an email with reset token should be sent to :recipient in :localeCode locale |
||
57 | */ |
||
58 | public function anEmailWithResetTokenShouldBeSentTo(string $recipient, string $localeCode = 'en_US'): void |
||
65 | |||
66 | /** |
||
67 | * @Then an email with the :method shipment's confirmation for the :orderNumber order should be sent to :email |
||
68 | */ |
||
69 | public function anEmailWithShipmentsConfirmationForTheOrderShouldBeSentTo(string $method, string $orderNumber, string $recipient): void |
||
80 | |||
81 | /** |
||
82 | * @Then :count email(s) should be sent to :recipient |
||
83 | */ |
||
84 | public function numberOfEmailsShouldBeSentTo(int $count, string $recipient): void |
||
88 | |||
89 | /** |
||
90 | * @Then a welcoming email should have been sent to :recipient |
||
91 | * @Then a welcoming email should have been sent to :recipient in :localeCode locale |
||
92 | */ |
||
93 | public function aWelcomingEmailShouldHaveBeenSentTo(string $recipient, string $localeCode = 'en_US'): void |
||
100 | |||
101 | /** |
||
102 | * @Then an email with the confirmation of the order :order should be sent to :email |
||
103 | * @Then an email with the confirmation of the order :order should be sent to :email in :localeCode locale |
||
104 | */ |
||
105 | public function anEmailWithTheConfirmationOfTheOrderShouldBeSentTo( |
||
120 | |||
121 | /** |
||
122 | * @Then /^an email with the summary of (order placed by "[^"]+") should be sent to him$/ |
||
123 | * @Then /^an email with the summary of (order placed by "[^"]+") should be sent to him in ("([^"]+)" locale)$/ |
||
124 | */ |
||
125 | public function anEmailWithSummaryOfOrderPlacedByShouldBeSentTo(OrderInterface $order, string $localeCode = 'en_US'): void |
||
129 | |||
130 | /** |
||
131 | * @Then /^an email with shipment's details of (this order) should be sent to "([^"]+)"$/ |
||
132 | * @Then /^an email with shipment's details of (this order) should be sent to "([^"]+)" in ("([^"]+)" locale)$/ |
||
133 | * @Then an email with the shipment's confirmation of the order :order should be sent to :recipient |
||
134 | * @Then an email with the shipment's confirmation of the order :order should be sent to :recipient in :localeCode locale |
||
135 | */ |
||
136 | public function anEmailWithShipmentDetailsOfOrderShouldBeSentTo( |
||
166 | |||
167 | private function assertEmailContainsMessageTo(string $message, string $recipient): void |
||
171 | |||
172 | private function getShippingMethodName(OrderInterface $order): string |
||
182 | } |
||
183 |