Esempio n. 1
0
 /**
  * send a confirmation mail with order details to the customer $member
  *
  * @author Roland Lehmann <*****@*****.**>, Sebastian Diel <*****@*****.**>
  * @since 26.08.2011
  * @return void
  */
 public function sendConfirmationMail()
 {
     $params = array('MailOrderConfirmation' => array('Template' => 'MailOrderConfirmation', 'Recipient' => $this->CustomersEmail, 'Variables' => array('FirstName' => $this->SilvercartInvoiceAddress()->FirstName, 'Surname' => $this->SilvercartInvoiceAddress()->Surname, 'Salutation' => $this->SilvercartInvoiceAddress()->getSalutationText(), 'SilvercartOrder' => $this), 'Attachments' => null), 'MailOrderNotification' => array('Template' => 'MailOrderNotification', 'Recipient' => SilvercartConfig::DefaultMailOrderNotificationRecipient(), 'Variables' => array('FirstName' => $this->SilvercartInvoiceAddress()->FirstName, 'Surname' => $this->SilvercartInvoiceAddress()->Surname, 'Salutation' => $this->SilvercartInvoiceAddress()->getSalutationText(), 'SilvercartOrder' => $this), 'Attachments' => null));
     $result = $this->extend('updateConfirmationMail', $params);
     SilvercartShopEmail::send($params['MailOrderConfirmation']['Template'], $params['MailOrderConfirmation']['Recipient'], $params['MailOrderConfirmation']['Variables'], $params['MailOrderConfirmation']['Attachments']);
     SilvercartShopEmail::send($params['MailOrderNotification']['Template'], $params['MailOrderNotification']['Recipient'], $params['MailOrderNotification']['Variables'], $params['MailOrderNotification']['Attachments']);
     $this->extend('onAfterConfirmationMail');
 }
 /**
  * executed if there are no valdation errors on submit
  * Form data is saved in session
  *
  * @param SS_HTTPRequest $data     contains the frameworks form data
  * @param Form           $form     not used
  * @param array          $formData contains the modules form data
  *
  * @return void
  *
  * @author Sebastian Diel <*****@*****.**>
  * @since 16.06.2014
  */
 protected function submitSuccess($data, $form, $formData)
 {
     $formData['RevocationOrderData'] = str_replace('\\r\\n', "\n", $formData['RevocationOrderData']);
     $config = SilvercartConfig::getConfig();
     $country = DataObject::get_by_id('SilvercartCountry', $formData['Country']);
     $variables = array('Email' => $formData['Email'], 'Salutation' => $formData['Salutation'], 'FirstName' => $formData['FirstName'], 'Surname' => $formData['Surname'], 'Street' => $formData['Street'], 'StreetNumber' => $formData['StreetNumber'], 'Addition' => $formData['Addition'], 'Postcode' => $formData['Postcode'], 'City' => $formData['City'], 'Country' => $country, 'OrderDate' => $formData['OrderDate'], 'OrderNumber' => $formData['OrderNumber'], 'RevocationOrderData' => str_replace('\\r\\n', '<br/>', nl2br($formData['RevocationOrderData'])), 'CurrentDate' => $this->getCurrentDate(), 'ShopName' => $config->ShopName, 'ShopStreet' => $config->ShopStreet, 'ShopStreetNumber' => $config->ShopStreetNumber, 'ShopPostcode' => $config->ShopPostcode, 'ShopCity' => $config->ShopCity, 'ShopCountry' => $config->ShopCountry());
     SilvercartShopEmail::send('RevocationNotification', SilvercartConfig::DefaultMailOrderNotificationRecipient(), $variables);
     SilvercartShopEmail::send('RevocationConfirmation', $formData['Email'], $variables);
     $revocationPage = SilvercartRevocationFormPage::get()->first();
     $this->Controller()->redirect($revocationPage->Link('success'));
 }