I created the form below which simply sends out a couple of emails. I need to update it so that it submits to Marketo. Does anyone have any experience? I've attached the PHP code (renamed marketo.txt so that I would be able to upload it) supplied by Market but I'm now sure where to start. Any help would be appreciated.
Here's the code of the current form.
public function SignUpForm() {
// Sign Up Form Fields
$fields = new FieldSet(
new TextField('firstname','First Name*'),
new TextField('lastname','Last Name*'),
new TextField('creditunion', 'Credit Union*', $this->getSearchQuery()),
new EmailField('email','E-mail address*'),
new TextField('city','City*'),
new DropdownField('state', 'State', array(
'' => 'State',
'AL' => 'Alabama',
'AK' => 'Alaska',
'AZ' => 'Arizona'
)),
new HiddenField ('cn', 'CN')
);
// On Submit
$actions = new FieldSet(
new FormAction('doSignUp', 'Submit')
);
// Fields to validate
$validator = new RequiredFields('firstname', 'lastname', 'creditunion', 'email');
return new Form($this, 'SignUpForm', $fields, $actions, $validator);
}
function doSignUp($data, $form) {
// Send Email to Admin
// Send Email to User
Director::redirect(Director::baseURL(). $this->URLSegment . "/?signupsuccess=1");
}