Esempio n. 1
0
 /**
  * testSendProfileUpdatedAdminNotification
  *
  * @return void
  * @access public
  * @see    ____func_see____
  * @since  1.0.0
  */
 public function testSendProfileUpdatedAdminNotification()
 {
     $profile = self::$admin_profile;
     $this->startCheckingMail();
     \XLite\Core\Mailer::sendProfileUpdatedAdminNotification($profile);
     sleep(3);
     $emails = $this->finishCheckingMail();
     if (empty($emails)) {
         $this->markTestSkipped('Email notification not found in the mail box');
     }
     $email = array_shift($emails);
     $this->assertRegexp('/To: ' . preg_quote(self::ADMIN_EMAIL) . '/msS', $email['header'], 'Wrong email recipient' . $email['header']);
     $this->assertRegexp('/User profile is modified/msS', $email['body'], '"User profile is modified" text not found in the email body');
 }
Esempio n. 2
0
 /**
  * actionPostprocessModify
  *
  * @return void
  */
 protected function actionPostprocessModify()
 {
     $params = array();
     if ($this->getModelForm()->isRegisterMode()) {
         // New profile is registered
         if ($this->isActionError()) {
             // Return back to register page
             $params = array('mode' => self::getRegisterMode());
         } else {
             // Send notification to the user
             \XLite\Core\Mailer::sendProfileCreatedUserNotification($this->getProfile());
             // Send notification to the users department
             \XLite\Core\Mailer::sendProfileCreatedAdminNotification($this->getProfile());
             // Return to the created profile page
             $params = array('profile_id' => $this->getProfile()->getProfileId());
         }
     } else {
         // Existsing profile is updated
         // Send notification to the user
         \XLite\Core\Mailer::sendProfileUpdatedUserNotification($this->getProfile());
         // Send notification to the users department
         \XLite\Core\Mailer::sendProfileUpdatedAdminNotification($this->getProfile());
         // Get profile ID from modified profile model
         $profileId = $this->getProfile()->getProfileId();
         // Return to the profile page
         $params = array('profile_id' => $profileId);
     }
     if (!empty($params)) {
         $this->setReturnURL($this->buildURL('profile', '', $params));
     }
 }
Esempio n. 3
0
 /**
  * doActionUpdate
  *
  * @return void
  */
 protected function doActionUpdate()
 {
     $result = $this->getModelForm()->performAction('update');
     if ($result) {
         // Send notification to the user
         \XLite\Core\Mailer::sendProfileUpdatedUserNotification($this->getModelForm()->getModelObject());
         // Send notification to the users department
         \XLite\Core\Mailer::sendProfileUpdatedAdminNotification($this->getModelForm()->getModelObject());
     }
     return $result;
 }