MailEventListener example

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);

        $dispatcher = $this->getContainer()->get('event_dispatcher');

        $dispatcher->addListener(FlowSendMailActionEvent::class$listener);

        $result = $closure($listener);

        $dispatcher->removeListener(FlowSendMailActionEvent::class$listener);

        return $result;
    }

    
Home | Imprint | This part of the site doesn't use cookies.