Example #1
0
 public static function sendNotification($admin_email, $subject, $message, $adminfullName)
 {
     $email = Yii::app()->email;
     $link = CHtml::link('Click here', 'http://' . Yii::app()->request->getServerName() . '/coplat/index.php');
     $html = User::replaceMessage($adminfullName, $message);
     $email->to = $admin_email;
     $email->from = 'Collaborative Platform <*****@*****.**>';
     $email->replyTo = '*****@*****.**';
     $email->returnPath = "*****@*****.**";
     $email->subject = $subject;
     $email->message = $html;
     $email->send();
 }
Example #2
0
 public function actionApply($jobid)
 {
     $user = User::getCurrentUser();
     $job = Job::model()->findByPk($jobid);
     $poster = User::model()->findByPk($job->FK_poster);
     $application = new Application();
     $application->jobid = $job->id;
     $application->userid = $user->id;
     $application->application_date = date('Y-m-d H:i:s');
     $application->coverletter = $this->mynl2br($_POST['Application']['coverletter']);
     $application->save(false);
     $link = 'http://' . Yii::app()->request->getServerName() . '/JobFair/index.php/profile/student/user/' . $user->username;
     $link1 = CHtml::link('click here to see ' . $user->username . ' profile', 'http://' . Yii::app()->request->getServerName() . '/JobFair/index.php/profile/student/user/' . $user->username);
     $message = "The User " . $user->username . " just applied for your job " . $job->title . ". Click here to view his profile";
     $message1 = "{$user->username} just applied for your job {$job->title}<br/>{$link1}";
     $html = User::replaceMessage($poster->username, $message1);
     User::sendEmployerNotificationAlart($user->id, $job->FK_poster, $message, $link, 3);
     User::sendEmail($poster->email, "Virtual Job Fair Application Submitted", "New Application Submitted", $message1);
     //User::sendEmailNotificationAlart($poster->email, $poster->username, $user->username ,$message1);
     $this->redirect("/JobFair/index.php/Job/View/jobid/" . $jobid);
 }