hi
how to send the form ?
i have
class TourPage_Controller extends Page_Controller {
...
function MyForm() {
// Create fields
$fields = new FieldSet(
new TextField('FirstName', 'First name'),
new EmailField('Email', 'Email addres')
);
function forTemplate() {
return $this->renderWith(array(
$this->class,
'Form'
));
}
// Create actions
$actions = new FieldSet(
new FormAction('doMyForm', 'Send')
);
return new Form($this, 'MyForm', $fields, $actions);
}
function doMyForm($data, $form) {
$email = new Email_Template(
$data['Email'],
'my@gmail.com',
'good work'
);
$email->ss_template = 'MyForm';
$email->populateTemplate(array (
'Name' => $data['FirstName'],
'Email' => $data['Email'],
));
$email->send();
}
...
}
but it doesn't work
i have MyForm.ss in templates/email but i don't know what it should contains
could you give me some example code for my form which i should put into MyForm.ss ?