我想知道如何提高联系表格的速度。 CakeEmail在您提交地址时发送两封电子邮件,然后重定向到下一个视图。任何建议如何改善这一点,所以直接重定向用户和电子邮件单独发送?
感谢您的帮助!提前谢谢!
// Controller
public function registerShort() {
$this->layout = 'guest';
if ($this->request->is('post')) {
$Email = new CakeEmail();
$Email->template('candidates_register_short', 'default')
->emailFormat('html')
->config('bewerber')
->from(array('bewerber@mueller.de' => 'Herr Müller'))
->to($this->request->data['Candidate']['email'])
->subject('Dankeschön')
->send();
$Email = new CakeEmail();
$Email->config('admin');
$Email->from(array('admin@mueller.de' => 'Mueller.de'));
$Email->to('bewerber@mueller.de');
$Email->subject('Neuer Eintrag: Kandidat');
$Email->send($this->request->data['Candidate']['email']);
$this->redirect(array('controller' => 'candidates', 'action' => 'registerDetail'));
}
$this->loadModel('EnquiryType');
$enquiryTypes = $this->EnquiryType->find('list');
$this->set(compact('enquiryTypes'));
}