/** * Sends the notification e-mail for the given customer address and products * * @param MShop_Context_Item_Interface $context Context item object * @param MShop_Common_Item_Address_Interface $address Payment address of the customer * @param array $products List of products a notification should be sent for */ protected function _sendMail(MShop_Context_Item_Interface $context, MShop_Common_Item_Address_Interface $address, array $products) { $view = $context->getView(); $view->extProducts = $products; $view->extAddressItem = $address; $helper = new MW_View_Helper_Translate_Default($view, $context->getI18n($address->getLanguageId())); $view->addHelper('translate', $helper); $mailer = $context->getMail(); $message = $mailer->createMessage(); $helper = new MW_View_Helper_Mail_Default($view, $message); $view->addHelper('mail', $helper); $client = $this->_getClient($context); $client->setView($view); $client->getHeader(); $client->getBody(); $mailer->send($message); }
/** * Copys all data from a given address. * * @param MShop_Common_Item_Address_Interface $address New address */ public function copyFrom(MShop_Common_Item_Address_Interface $address) { $this->setAddressId($address->getId()); $this->setCompany($address->getCompany()); $this->setVatID($address->getVatID()); $this->setSalutation($address->getSalutation()); $this->setTitle($address->getTitle()); $this->setFirstname($address->getFirstname()); $this->setLastname($address->getLastname()); $this->setAddress1($address->getAddress1()); $this->setAddress2($address->getAddress2()); $this->setAddress3($address->getAddress3()); $this->setPostal($address->getPostal()); $this->setCity($address->getCity()); $this->setState($address->getState()); $this->setCountryId($address->getCountryId()); $this->setTelephone($address->getTelephone()); $this->setEmail($address->getEmail()); $this->setTelefax($address->getTelefax()); $this->setWebsite($address->getWebsite()); $this->setLanguageId($address->getLanguageId()); $this->setFlag($address->getFlag()); $this->setModified(); }