CakePHPで会員登録フォームに入力されたメールアドレスに本会員登録用のリンクの貼られたメールを送りたいのですが、
Error:SQLSTATE[42000]:Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'getActiviationHash' at line 1 SQL Query:getActiviationHash.
というエラーが発生しています。
CakePHPの経験が浅く、突破口が掴めずにいます。
どなたか以下のコードで問題箇所などが分かる方がいらっしゃったらご指摘頂きたいです。
public $components = array('Auth');
public function beforeFilter(){
$this->Auth->allow('signup');
}
public function signup()
{
if($this->request->is('post')){
if($this->User->save($this->data)){
$url='activate/'.$this->User->id.'/'.$this->User->getActiviationHash();
$url=Router::url($url,true);
$email=new CakeEmail();
$email->from(array('[email protected]' =>'Sender'));
$email->to($this->data['User']['email']);
$email->subject('Registration mail');
$email->send($url);
$this->Session->setFlash('Registration suceessful');
}else{
$this->Session->setFlash('Error');
}
}
}
Cake/conf/Email.php
class EmailConfig {
public $default = array(
'transport' => 'Mail',
'from' => 'you@localhost',
//'charset' => 'utf-8',
//'headerCharset' => 'utf-8',
);
public $smtp = array(
'transport' => 'ssl://Smtp.gmail.com',
'from' => array('site@localhost' => 'My Site'),
'host' => 'localhost',
'port' => 587,
'timeout' => 30,
'username' => 'root',
'password' => 'root',
'client' => null,
'log' => false,
//'charset' => 'utf-8',
//'headerCharset' => 'utf-8',
);