Пример #1
0
 /**
  * send an email to the resource owner letting them know that a match was
  * submitted, along with the contact info
  */
 protected function sendContactEmail($contact, $body)
 {
     // send email based on $resource->transaction_type
     $message = $this->getMailer()->compose(sfConfig::get('app_email_from'), sfConfig::get('app_email_from'), dnConfig::getEmailSubject('contact'), $body);
     $message->setContentType('text/html');
     $this->getMailer()->send($message);
 }
Пример #2
0
 /**
  * Processes the "need time" form
  */
 protected function processAddNeedForm(sfWebRequest $request, sfForm $form)
 {
     $form->bind($request->getParameter($form->getName()));
     if ($form->isValid()) {
         $time = $form->save();
         $request->setAttribute('resource', $time);
         $body = $this->getController()->getPresentationFor('time', 'needEmail');
         $message = $this->getMailer()->compose(sfConfig::get('app_email_from'), $form->getValue('email'), dnConfig::getEmailSubject('need_time_creation'), $body);
         $message->setContentType('text/html');
         $this->getMailer()->send($message);
         $this->getUser()->setOwner($time);
         $this->redirect($this->generateUrl('time_show', array('sf_subject' => $time)));
     }
     $this->getUser()->setFlash('error', 'You are missing some of the required fields below.');
 }
Пример #3
0
 /**
  * Handles the form submit. Is submitted via ajax, doesn't degrade,
  * tough, we're in a hurry
  */
 public function executeSendLoginTokenProcess(sfWebRequest $request)
 {
     $this->form = new sendLoginTokenForm();
     $this->form->bind($request->getParameter('send_login'));
     if ($this->form->isValid()) {
         $user = $this->form->getUser();
         $request->setAttribute('user', $user);
         $body = $this->getController()->getPresentationFor('user', 'sendLoginTokenEmail');
         $message = $this->getMailer()->compose(sfConfig::get('app_email_from'), $this->form->getValue('email'), dnConfig::getEmailSubject('send_token_email'), $body);
         $message->setContentType('text/html');
         $this->getMailer()->send($message);
         // render the confirmation partial
         $this->email = $this->form->getValue('email');
         $this->renderPartial('user/sendTokenConfirmation');
     } else {
         $this->renderPartial('sendLoginTokenForm');
     }
     return sfView::NONE;
 }
Пример #4
0
 /**
  * send an email to the resource owner letting them know that a match was
  * submitted, along with the contact info
  */
 protected function sendMatchFoundEmail($resource, $contact)
 {
     $this->getRequest()->setAttribute('resource', $resource);
     $this->getRequest()->setAttribute('contact', $contact);
     // send email based on $resource->transaction_type
     $body = $this->getController()->getPresentationFor('stuff', 'matchEmail');
     $message = $this->getMailer()->compose(sfConfig::get('app_email_from'), $resource->User->username, dnConfig::getEmailSubject('match_found'), $body);
     $message->setContentType('text/html');
     $this->getMailer()->send($message);
 }