sent example

$customerId = $customer->id;
        }

        return $this->getContext($context->getToken()[
            SalesChannelContextService::CUSTOMER_ID => $customerId,
        ]);
    }

    protected function assertMailSent(MailEventListener $listener, string $type): void
    {
        static::assertTrue($listener->sent($type), \sprintf('Mail with type %s was not sent', $type));
    }

    /** * @return mixed */
    protected function mailListener(\Closure $closure)
    {
        $mapping = $this->getContainer()->get(Connection::class)
            ->fetchAllKeyValue('SELECT LOWER(HEX(id)), technical_name FROM mail_template_type');

        $listener = new MailEventListener($mapping);

        


    public function __invoke(FlowSendMailActionEvent $event): void
    {
        $name = $this->mapping[$event->getMailTemplate()->getMailTemplateTypeId()];

        $this->events[$name][] = $event;
    }

    public function assertSent(string $type): void
    {
        TestCase::assertTrue($this->sent($type), \sprintf('Expected to send %s mail', $type));
    }

    public function sent(string $type): bool
    {
        return !empty($this->events[$type]);
    }

    public function get(?string $type = null): array
    {
        return $type ? $this->events[$type] : $this->events;
    }
}
Home | Imprint | This part of the site doesn't use cookies.