I’ve created a function in my appController to sendemails:
protected function sendEmail($studentId = null, $courseId = null, $action = null) {
$course = $this->Course->find('first', array('conditions' => array('Course.id' => $courseId)));
if(! $course) {
throw new NotFoundException(__('Invalid course'));
}
}
I want to verify the course and student, but depending on which controller I call it from, I have to modify my $this->xxx->find statement. The only other solution I’ve came up with is validating/sending the $course/$student data head of time, but I’d still like to run a manual SQL query to save the email log (I’d run into the same problem). Any help?
I don’t understand very good your problem, but:
If it’s ok, or not, tel me.. come with an new ideea based on my code. I don’t now your database structure, but i think that works an join query…