mail url
This commit is contained in:
parent
06113de208
commit
c169fd9305
|
@ -13,11 +13,12 @@ class RegistrationController extends AppController {
|
|||
public $componens = array('Email','MiconwareSession');
|
||||
public $uses = array('Mannerofaddress','DreamjobListGraducation','DreamjobListBranch','DreamjobWorker','DreamjobCompany','User');
|
||||
|
||||
private function registrationMail($data,$key){
|
||||
public static function registrationMail($data){
|
||||
$Email = new CakeEmail('dreamjobMain');
|
||||
$Email->to($data['User']['mail']);
|
||||
$Email->subject('Welcome to our really cool thing');
|
||||
$Email->template('registration');
|
||||
$key = substr($data['User']['code'],2);
|
||||
$Email->viewVars(array('data'=>$data,'key'=>$key));
|
||||
return $Email->send();
|
||||
}
|
||||
|
@ -61,12 +62,6 @@ class RegistrationController extends AppController {
|
|||
$data['User']['is_active'] = false;
|
||||
|
||||
$result = $this->DreamjobCompany->registration($data);
|
||||
if($result){
|
||||
$result = $this->registrationMail($data,$key);
|
||||
if($result){
|
||||
$this->log("Registratrion Mail:"+$data['User']['mail']);
|
||||
}
|
||||
}
|
||||
if ($result) {
|
||||
$this->MiconwareSession->setFlash('dreamjob.registration.done','flash',array('alert'=>'success'));
|
||||
}else{
|
||||
|
|
|
@ -140,7 +140,8 @@ class DreamjobCompany extends AppModel {
|
|||
$result = $this->User->saveField('mannerofaddress_id',$data['AppUser']['mannerofaddress_id']);
|
||||
}
|
||||
|
||||
|
||||
if($result)
|
||||
$result = RegistrationController::registrationMail($data);
|
||||
|
||||
if ($result) {
|
||||
$dataSource->commit();
|
||||
|
|
|
@ -86,6 +86,8 @@ class DreamjobWorker extends AppModel {
|
|||
$this->create(array('DreamjobWorker'=>$data['DreamjobWorker']));
|
||||
$result=$this->save();
|
||||
}
|
||||
if($result)
|
||||
$result = RegistrationController::registrationMail($data);
|
||||
|
||||
if ($result) {
|
||||
$dataSource->commit();
|
||||
|
|
Loading…
Reference in New Issue