/** * testSendProfileUpdatedUserNotification * * @return void * @access public * @see ____func_see____ * @since 1.0.0 */ public function testSendProfileUpdatedUserNotification() { $profile = self::$admin_profile; $this->startCheckingMail(); \XLite\Core\Mailer::sendProfileUpdatedUserNotification($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::TESTER_EMAIL) . '/msS', $email['header'], 'Wrong email recipient' . $email['header']); $this->assertRegexp('/Your profile has been modified/msS', $email['body'], '"Your profile has been modified" text not found in the email body'); }
/** * 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)); } }
/** * 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; }