/** * Test case * * @expectedException \Enlight_Exception */ public function testCreateMailWithInvalidTemplateNameShouldThrowException() { $this->mail->createMail('ThisIsNoTemplateName', array()); }
/** * @return \Shopware_Components_TemplateMail */ public function initTemplateMail() { $this->loadResource('MailTransport'); $stringCompiler = new Shopware_Components_StringCompiler( $this->getResource('Template') ); $mailer = new Shopware_Components_TemplateMail(); if($this->issetResource('Shop')) { $mailer->setShop($this->getResource('Shop')); } $mailer->setModelManager($this->getResource('Models')); $mailer->setStringCompiler($stringCompiler); return $mailer; }
/** * @param Container $container * @return \Shopware_Components_TemplateMail */ public function factory(Container $container) { $container->load('MailTransport'); $stringCompiler = new \Shopware_Components_StringCompiler($container->get('Template')); $mailer = new \Shopware_Components_TemplateMail(); if ($container->initialized('Shop')) { $mailer->setShop($container->get('Shop')); } $mailer->setModelManager($container->get('Models')); $mailer->setStringCompiler($stringCompiler); return $mailer; }