Hi all,
I have been working on this for some days but can't figure it out on my own.
Using the multiform module, I have 5 steps and the end results are to be emailed in one big email. The trouble I am having is all the data from setps 1,2,3 and 4 are being stored in the databse but its not included in the email, only the data from the last step is.
Here is the code;
<?php
class APMultiForm extends MultiForm {
public static $start_step = 'APPersonalDetailsFormStep';
public function finish($data, $form) {
parent::finish($data, $form);
$steps = DataObject::get('MultiFormStep', "SessionID = {$this->session->ID}");
$From = "website";
$To = "email";
$Subject = "Subject";
$email = new Email($From, $To, $Subject);
$email->setTemplate('AuPairEmail');
$email->populateTemplate($data);
$email->send();
Director::redirect(Director::baseURL(). $this->URLSegment . "terms-and-conditions");
}
}
If I change any of the steps to be the last step, then the data from that step is emailed fine.