/** * Returns the product notification e-mail client * * @param \Aimeos\MShop\Context\Item\Iface $context Context item object * @return \Aimeos\Client\Html\Iface Product notification e-mail client */ protected function getClient(\Aimeos\MShop\Context\Item\Iface $context) { if (!isset($this->client)) { $templatePaths = $this->getAimeos()->getCustomPaths('client/html/templates'); $this->client = \Aimeos\Client\Html\Email\Account\Factory::createClient($context, $templatePaths); } return $this->client; }
public function testCreateClientNameNotFound() { $this->setExpectedException('\\Aimeos\\Client\\Html\\Exception'); \Aimeos\Client\Html\Email\Account\Factory::createClient($this->context, $this->templatePaths, 'notfound'); }
/** * Sends the account creation e-mail to the e-mail address of the customer * * @param \Aimeos\MShop\Common\Item\Address\Iface $address Payment address item of the customer * @param string $code Customer login name * @param string $password Customer clear text password */ protected function sendEmail(\Aimeos\MShop\Common\Item\Address\Iface $address, $code, $password) { $context = $this->getContext(); $client = \Aimeos\Client\Html\Email\Account\Factory::createClient($context, $this->getTemplatePaths()); $view = $context->getView(); $view->extAccountCode = $code; $view->extAccountPassword = $password; $view->extAddressItem = $address; $mailer = $context->getMail(); $message = $mailer->createMessage(); $helper = new \Aimeos\MW\View\Helper\Mail\Standard($view, $message); $view->addHelper('mail', $helper); $client->setView($view); $client->getHeader(); $client->getBody(); $mailer->send($message); }